5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-09 02:50:46 +08:00

Fix tests

This commit is contained in:
Lea Anthony 2023-09-08 12:04:21 +10:00
parent 965f939967
commit b925335bbb
No known key found for this signature in database
GPG Key ID: 33DAF7BB90A58405
18 changed files with 555 additions and 800 deletions

View File

@ -52,7 +52,7 @@ func TestGenerateIcon(t *testing.T) {
_, thisFile, _, _ := runtime.Caller(1) _, thisFile, _, _ := runtime.Caller(1)
localDir := filepath.Dir(thisFile) localDir := filepath.Dir(thisFile)
// Get the path to the example icon // Get the path to the example icon
exampleIcon := filepath.Join(localDir, "examples", "appicon.png") exampleIcon := filepath.Join(localDir, "defaults", "appicon.png")
return &IconsOptions{ return &IconsOptions{
Input: exampleIcon, Input: exampleIcon,
WindowsFilename: "appicon.ico", WindowsFilename: "appicon.ico",
@ -94,7 +94,7 @@ func TestGenerateIcon(t *testing.T) {
_, thisFile, _, _ := runtime.Caller(1) _, thisFile, _, _ := runtime.Caller(1)
localDir := filepath.Dir(thisFile) localDir := filepath.Dir(thisFile)
// Get the path to the example icon // Get the path to the example icon
exampleIcon := filepath.Join(localDir, "examples", "appicon.png") exampleIcon := filepath.Join(localDir, "defaults", "appicon.png")
return &IconsOptions{ return &IconsOptions{
Input: exampleIcon, Input: exampleIcon,
MacFilename: "appicon.icns", MacFilename: "appicon.icns",
@ -133,7 +133,7 @@ func TestGenerateIcon(t *testing.T) {
_, thisFile, _, _ := runtime.Caller(1) _, thisFile, _, _ := runtime.Caller(1)
localDir := filepath.Dir(thisFile) localDir := filepath.Dir(thisFile)
// Get the path to the example icon // Get the path to the example icon
exampleIcon := filepath.Join(localDir, "examples", "appicon.png") exampleIcon := filepath.Join(localDir, "defaults", "appicon.png")
return &IconsOptions{ return &IconsOptions{
Input: exampleIcon, Input: exampleIcon,
Sizes: "16", Sizes: "16",
@ -181,7 +181,7 @@ func TestGenerateIcon(t *testing.T) {
_, thisFile, _, _ := runtime.Caller(1) _, thisFile, _, _ := runtime.Caller(1)
localDir := filepath.Dir(thisFile) localDir := filepath.Dir(thisFile)
// Get the path to the example icon // Get the path to the example icon
exampleIcon := filepath.Join(localDir, "examples", "appicon.png") exampleIcon := filepath.Join(localDir, "defaults", "appicon.png")
return &IconsOptions{ return &IconsOptions{
Input: exampleIcon, Input: exampleIcon,
} }
@ -195,7 +195,7 @@ func TestGenerateIcon(t *testing.T) {
_, thisFile, _, _ := runtime.Caller(1) _, thisFile, _, _ := runtime.Caller(1)
localDir := filepath.Dir(thisFile) localDir := filepath.Dir(thisFile)
// Get the path to the example icon // Get the path to the example icon
exampleIcon := filepath.Join(localDir, "examples", "appicon.png") exampleIcon := filepath.Join(localDir, "defaults", "appicon.png")
return &IconsOptions{ return &IconsOptions{
Input: exampleIcon, Input: exampleIcon,
WindowsFilename: "appicon.ico", WindowsFilename: "appicon.ico",
@ -211,7 +211,7 @@ func TestGenerateIcon(t *testing.T) {
_, thisFile, _, _ := runtime.Caller(1) _, thisFile, _, _ := runtime.Caller(1)
localDir := filepath.Dir(thisFile) localDir := filepath.Dir(thisFile)
// Get the path to the example icon // Get the path to the example icon
exampleIcon := filepath.Join(localDir, "examples", "appicon.png") exampleIcon := filepath.Join(localDir, "defaults", "appicon.png")
return &IconsOptions{ return &IconsOptions{
Input: exampleIcon, Input: exampleIcon,
WindowsFilename: "appicon.ico", WindowsFilename: "appicon.ico",

View File

@ -1,39 +0,0 @@
package commands
import "testing"
func TestBuild(t *testing.T) {
type args struct {
options *RunTaskOptions
otherArgs []string
}
tests := []struct {
name string
args args
wantErr bool
}{
{
name: "should error if task name not provided",
args: args{
options: &RunTaskOptions{},
},
wantErr: true,
},
{
name: "should work if task name provided",
args: args{
options: &RunTaskOptions{
Name: "build",
},
},
wantErr: true,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if err := RunTask(tt.args.options, tt.args.otherArgs); (err != nil) != tt.wantErr {
t.Errorf("Run() error = %v, wantErr %v", err, tt.wantErr)
}
})
}
}

View File

@ -18,7 +18,7 @@ const header = `// @ts-check
const bindingTemplate = ` const bindingTemplate = `
/** /**
* {{structName}}.{{methodName}} * {{structName}}.{{methodName}}
* Comments *Comments
* @param name {string} * @param name {string}
* @returns {Promise<string>} * @returns {Promise<string>}
**/ **/
@ -108,6 +108,9 @@ func GenerateBinding(structName string, method *BoundMethod) (string, []string)
result = strings.ReplaceAll(result, "{{methodName}}", method.Name) result = strings.ReplaceAll(result, "{{methodName}}", method.Name)
result = strings.ReplaceAll(result, "{{ID}}", fmt.Sprintf("%v", method.ID)) result = strings.ReplaceAll(result, "{{ID}}", fmt.Sprintf("%v", method.ID))
comments := strings.TrimSpace(method.DocComment) comments := strings.TrimSpace(method.DocComment)
if comments != "" {
comments = " " + comments
}
result = strings.ReplaceAll(result, "Comments", comments) result = strings.ReplaceAll(result, "Comments", comments)
var params string var params string
for _, input := range method.Inputs { for _, input := range method.Inputs {
@ -238,7 +241,7 @@ window.go = window.go || {};
for _, method := range methods { for _, method := range methods {
thisBinding, models := GenerateBinding(structName, method) thisBinding, models := GenerateBinding(structName, method)
allModels = append(allModels, models...) allModels = append(allModels, models...)
result[normalisedPackageNames[packageName]] += " " + thisBinding result[normalisedPackageNames[packageName]] += thisBinding
} }
result[normalisedPackageNames[packageName]] += " },\n" result[normalisedPackageNames[packageName]] += " },\n"
} }

View File

@ -110,6 +110,11 @@ func TestGenerateBindings(t *testing.T) {
return return
} }
// compare the binding // compare the binding
// convert all line endings to \n
binding = convertLineEndings(binding)
expected = convertLineEndings(expected)
if diff := cmp.Diff(expected, binding); diff != "" { if diff := cmp.Diff(expected, binding); diff != "" {
err = os.WriteFile(tt.dir+"/bindings_"+name+".got.js", []byte(binding), 0644) err = os.WriteFile(tt.dir+"/bindings_"+name+".got.js", []byte(binding), 0644)
if err != nil { if err != nil {

View File

@ -4,6 +4,7 @@ import (
"github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp"
"os" "os"
"path/filepath" "path/filepath"
"strings"
"testing" "testing"
) )
@ -63,8 +64,10 @@ func TestGenerateModels(t *testing.T) {
if err != nil { if err != nil {
t.Fatalf("GenerateModels() error = %v", err) t.Fatalf("GenerateModels() error = %v", err)
} }
// convert all line endings to \n
if diff := cmp.Diff(tt.want, got); diff != "" { got = convertLineEndings(got)
want := convertLineEndings(tt.want)
if diff := cmp.Diff(want, got); diff != "" {
err = os.WriteFile(filepath.Join(tt.dir, "models.got.ts"), []byte(got), 0644) err = os.WriteFile(filepath.Join(tt.dir, "models.got.ts"), []byte(got), 0644)
if err != nil { if err != nil {
t.Errorf("os.WriteFile() error = %v", err) t.Errorf("os.WriteFile() error = %v", err)
@ -75,3 +78,8 @@ func TestGenerateModels(t *testing.T) {
}) })
} }
} }
func convertLineEndings(str string) string {
// replace all \r\n with \n
return strings.ReplaceAll(str, "\r\n", "\n")
}

View File

@ -40,6 +40,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 1411160069,
}, },
{ {
Name: "NoInputsStringOut", Name: "NoInputsStringOut",
@ -53,6 +54,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 1075577233,
}, },
{ {
Name: "StringArrayInputStringOut", Name: "StringArrayInputStringOut",
@ -72,6 +74,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 1091960237,
}, },
{ {
Name: "StringArrayInputStringArrayOut", Name: "StringArrayInputStringArrayOut",
@ -92,6 +95,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 383995060,
}, },
{ {
Name: "StringArrayInputNamedOutput", Name: "StringArrayInputNamedOutput",
@ -113,6 +117,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 3678582682,
}, },
{ {
Name: "StringArrayInputNamedOutputs", Name: "StringArrayInputNamedOutputs",
@ -140,6 +145,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 319259595,
}, },
{ {
Name: "IntPointerInputNamedOutputs", Name: "IntPointerInputNamedOutputs",
@ -166,6 +172,7 @@ func TestParseDirectory(t *testing.T) {
Name: "error", Name: "error",
}}, }},
}, },
ID: 2718999663,
}, },
{ {
Name: "UIntPointerInAndOutput", Name: "UIntPointerInAndOutput",
@ -186,6 +193,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 1367187362,
}, },
{ {
Name: "UInt8PointerInAndOutput", Name: "UInt8PointerInAndOutput",
@ -206,6 +214,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 518250834,
}, },
{ {
Name: "UInt16PointerInAndOutput", Name: "UInt16PointerInAndOutput",
@ -226,6 +235,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 1236957573,
}, },
{ {
Name: "UInt32PointerInAndOutput", Name: "UInt32PointerInAndOutput",
@ -246,6 +256,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 1739300671,
}, },
{ {
Name: "UInt64PointerInAndOutput", Name: "UInt64PointerInAndOutput",
@ -266,6 +277,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 1403757716,
}, },
{ {
Name: "IntPointerInAndOutput", Name: "IntPointerInAndOutput",
@ -286,6 +298,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 1066151743,
}, },
{ {
Name: "Int8PointerInAndOutput", Name: "Int8PointerInAndOutput",
@ -306,6 +319,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 2189402897,
}, },
{ {
Name: "Int16PointerInAndOutput", Name: "Int16PointerInAndOutput",
@ -326,6 +340,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 1754277916,
}, },
{ {
Name: "Int32PointerInAndOutput", Name: "Int32PointerInAndOutput",
@ -346,6 +361,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 4251088558,
}, },
{ {
Name: "Int64PointerInAndOutput", Name: "Int64PointerInAndOutput",
@ -366,6 +382,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 2205561041,
}, },
{ {
Name: "IntInIntOut", Name: "IntInIntOut",
@ -384,6 +401,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 642881729,
}, },
{ {
Name: "Int8InIntOut", Name: "Int8InIntOut",
@ -402,6 +420,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 572240879,
}, },
{ {
Name: "Int16InIntOut", Name: "Int16InIntOut",
@ -420,6 +439,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 3306292566,
}, },
{ {
Name: "Int32InIntOut", Name: "Int32InIntOut",
@ -438,6 +458,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 1909469092,
}, },
{ {
Name: "Int64InIntOut", Name: "Int64InIntOut",
@ -456,6 +477,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 1343888303,
}, },
{ {
Name: "UIntInUIntOut", Name: "UIntInUIntOut",
@ -474,6 +496,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 2836661285,
}, },
{ {
Name: "UInt8InUIntOut", Name: "UInt8InUIntOut",
@ -492,6 +515,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 2988345717,
}, },
{ {
Name: "UInt16InUIntOut", Name: "UInt16InUIntOut",
@ -510,6 +534,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 3401034892,
}, },
{ {
Name: "UInt32InUIntOut", Name: "UInt32InUIntOut",
@ -528,6 +553,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 1160383782,
}, },
{ {
Name: "UInt64InUIntOut", Name: "UInt64InUIntOut",
@ -546,6 +572,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 793803239,
}, },
{ {
Name: "Float32InFloat32Out", Name: "Float32InFloat32Out",
@ -564,6 +591,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 3132595881,
}, },
{ {
Name: "Float64InFloat64Out", Name: "Float64InFloat64Out",
@ -582,6 +610,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 2182412247,
}, },
{ {
Name: "PointerFloat32InFloat32Out", Name: "PointerFloat32InFloat32Out",
@ -602,6 +631,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 224675106,
}, },
{ {
Name: "PointerFloat64InFloat64Out", Name: "PointerFloat64InFloat64Out",
@ -622,6 +652,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 2124953624,
}, },
{ {
Name: "BoolInBoolOut", Name: "BoolInBoolOut",
@ -640,6 +671,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 2424639793,
}, },
{ {
Name: "PointerBoolInBoolOut", Name: "PointerBoolInBoolOut",
@ -660,6 +692,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 3589606958,
}, },
{ {
Name: "PointerStringInStringOut", Name: "PointerStringInStringOut",
@ -680,6 +713,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 229603958,
}, },
{ {
Name: "StructPointerInputErrorOutput", Name: "StructPointerInputErrorOutput",
@ -701,6 +735,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 2447692557,
}, },
{ {
Name: "StructInputStructOutput", Name: "StructInputStructOutput",
@ -723,6 +758,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 3835643147,
}, },
{ {
Name: "StructPointerInputStructPointerOutput", Name: "StructPointerInputStructPointerOutput",
@ -747,6 +783,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 2943477349,
}, },
{ {
Name: "MapIntInt", Name: "MapIntInt",
@ -764,6 +801,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 2386486356,
}, },
{ {
Name: "PointerMapIntInt", Name: "PointerMapIntInt",
@ -782,6 +820,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 3516977899,
}, },
{ {
Name: "MapIntPointerInt", Name: "MapIntPointerInt",
@ -800,6 +839,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 550413585,
}, },
{ {
Name: "MapIntSliceInt", Name: "MapIntSliceInt",
@ -818,6 +858,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 2900172572,
}, },
{ {
Name: "MapIntSliceIntInMapIntSliceIntOut", Name: "MapIntSliceIntInMapIntSliceIntOut",
@ -851,6 +892,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 881980169,
}, },
{ {
Name: "ArrayInt", Name: "ArrayInt",
@ -863,6 +905,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 3862002418,
}, },
}, },
}, },
@ -956,11 +999,13 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 1411160069,
}, },
}, },
"OtherService": { "OtherService": {
{ {
Name: "Hello", Name: "Hello",
ID: 4249972365,
}, },
}, },
}, },
@ -992,11 +1037,13 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 1411160069,
}, },
}, },
"OtherService": { "OtherService": {
{ {
Name: "Hello", Name: "Hello",
ID: 4249972365,
}, },
}, },
}, },
@ -1029,6 +1076,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 1411160069,
}, },
{ {
Name: "NewPerson", Name: "NewPerson",
@ -1052,6 +1100,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 1661412647,
}, },
}, },
}, },
@ -1069,6 +1118,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 469445984,
}, },
}, },
}, },
@ -1149,6 +1199,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 1411160069,
}, },
}, },
}, },
@ -1180,6 +1231,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 1411160069,
}, },
}, },
}, },
@ -1211,6 +1263,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 1411160069,
}, },
{ {
Name: "NewPerson", Name: "NewPerson",
@ -1234,6 +1287,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 1661412647,
}, },
}, },
}, },
@ -1251,6 +1305,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 302702907,
}, },
}, },
}, },
@ -1331,6 +1386,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 1411160069,
}, },
}, },
}, },
@ -1362,6 +1418,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 1411160069,
}, },
{ {
Name: "NewPerson", Name: "NewPerson",
@ -1385,6 +1442,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 1661412647,
}, },
}, },
}, },
@ -1402,6 +1460,7 @@ func TestParseDirectory(t *testing.T) {
}, },
}, },
}, },
ID: 302702907,
}, },
}, },
}, },

View File

@ -4,40 +4,25 @@
import {main} from './models'; import {main} from './models';
function GreetService(method) {
return {
packageName: "main",
serviceName: "GreetService",
methodName: method,
args: Array.prototype.slice.call(arguments, 1),
};
}
/**
* GreetService.Greet
* Greet does XYZ
* @param name {string}
* @returns {Promise<string>}
**/
function Greet(name) {
return wails.Call(GreetService("Greet", name));
}
/**
* GreetService.NewPerson
* NewPerson creates a new person
* @param name {string}
* @returns {Promise<main.Person | null>}
**/
function NewPerson(name) {
return wails.Call(GreetService("NewPerson", name));
}
window.go = window.go || {}; window.go = window.go || {};
window.go.main = { window.go.main = {
GreetService: { GreetService: {
Greet,
NewPerson, /**
* GreetService.Greet
* Greet does XYZ
* @param name {string}
* @returns {Promise<string>}
**/
Greet: function(name) { wails.CallByID(1411160069, ...Array.prototype.slice.call(arguments, 0)); },
/**
* GreetService.NewPerson
* NewPerson creates a new person
* @param name {string}
* @returns {Promise<main.Person | null>}
**/
NewPerson: function(name) { wails.CallByID(1661412647, ...Array.prototype.slice.call(arguments, 0)); },
}, },
}; };

View File

@ -4,29 +4,17 @@
import {services} from './models'; import {services} from './models';
function OtherService(method) {
return {
packageName: "services",
serviceName: "OtherService",
methodName: method,
args: Array.prototype.slice.call(arguments, 1),
};
}
/**
* OtherService.Yay
*
*
* @returns {Promise<services.Address | null>}
**/
function Yay() {
return wails.Call(OtherService("Yay"));
}
window.go = window.go || {}; window.go = window.go || {};
window.go.services = { window.go.services = {
OtherService: { OtherService: {
Yay,
/**
* OtherService.Yay
*
*
* @returns {Promise<services.Address | null>}
**/
Yay: function() { wails.CallByID(302702907, ...Array.prototype.slice.call(arguments, 0)); },
}, },
}; };

View File

@ -2,49 +2,27 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL // Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT // This file is automatically generated. DO NOT EDIT
function GreetService(method) {
return {
packageName: "main",
serviceName: "GreetService",
methodName: method,
args: Array.prototype.slice.call(arguments, 1),
};
}
/**
* GreetService.Greet
*
* @param name {string}
* @returns {Promise<string>}
**/
function Greet(name) {
return wails.Call(GreetService("Greet", name));
}
function OtherService(method) {
return {
packageName: "main",
serviceName: "OtherService",
methodName: method,
args: Array.prototype.slice.call(arguments, 1),
};
}
/**
* OtherService.Hello
*
*
* @returns {Promise<void>}
**/
function Hello() {
return wails.Call(OtherService("Hello"));
}
window.go = window.go || {}; window.go = window.go || {};
window.go.main = { window.go.main = {
GreetService: { GreetService: {
Greet,
/**
* GreetService.Greet
*
* @param name {string}
* @returns {Promise<string>}
**/
Greet: function(name) { wails.CallByID(1411160069, ...Array.prototype.slice.call(arguments, 0)); },
}, },
OtherService: { OtherService: {
Hello,
/**
* OtherService.Hello
*
*
* @returns {Promise<void>}
**/
Hello: function() { wails.CallByID(4249972365, ...Array.prototype.slice.call(arguments, 0)); },
}, },
}; };

View File

@ -2,49 +2,27 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL // Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT // This file is automatically generated. DO NOT EDIT
function GreetService(method) {
return {
packageName: "main",
serviceName: "GreetService",
methodName: method,
args: Array.prototype.slice.call(arguments, 1),
};
}
/**
* GreetService.Greet
*
* @param name {string}
* @returns {Promise<string>}
**/
function Greet(name) {
return wails.Call(GreetService("Greet", name));
}
function OtherService(method) {
return {
packageName: "main",
serviceName: "OtherService",
methodName: method,
args: Array.prototype.slice.call(arguments, 1),
};
}
/**
* OtherService.Hello
*
*
* @returns {Promise<void>}
**/
function Hello() {
return wails.Call(OtherService("Hello"));
}
window.go = window.go || {}; window.go = window.go || {};
window.go.main = { window.go.main = {
GreetService: { GreetService: {
Greet,
/**
* GreetService.Greet
*
* @param name {string}
* @returns {Promise<string>}
**/
Greet: function(name) { wails.CallByID(1411160069, ...Array.prototype.slice.call(arguments, 0)); },
}, },
OtherService: { OtherService: {
Hello,
/**
* OtherService.Hello
*
*
* @returns {Promise<void>}
**/
Hello: function() { wails.CallByID(4249972365, ...Array.prototype.slice.call(arguments, 0)); },
}, },
}; };

View File

@ -4,40 +4,25 @@
import {main} from './models'; import {main} from './models';
function GreetService(method) {
return {
packageName: "main",
serviceName: "GreetService",
methodName: method,
args: Array.prototype.slice.call(arguments, 1),
};
}
/**
* GreetService.Greet
* Greet does XYZ
* @param name {string}
* @returns {Promise<string>}
**/
function Greet(name) {
return wails.Call(GreetService("Greet", name));
}
/**
* GreetService.NewPerson
* NewPerson creates a new person
* @param name {string}
* @returns {Promise<main.Person | null>}
**/
function NewPerson(name) {
return wails.Call(GreetService("NewPerson", name));
}
window.go = window.go || {}; window.go = window.go || {};
window.go.main = { window.go.main = {
GreetService: { GreetService: {
Greet,
NewPerson, /**
* GreetService.Greet
* Greet does XYZ
* @param name {string}
* @returns {Promise<string>}
**/
Greet: function(name) { wails.CallByID(1411160069, ...Array.prototype.slice.call(arguments, 0)); },
/**
* GreetService.NewPerson
* NewPerson creates a new person
* @param name {string}
* @returns {Promise<main.Person | null>}
**/
NewPerson: function(name) { wails.CallByID(1661412647, ...Array.prototype.slice.call(arguments, 0)); },
}, },
}; };

View File

@ -4,29 +4,17 @@
import {services} from './models'; import {services} from './models';
function OtherService(method) {
return {
packageName: "services",
serviceName: "OtherService",
methodName: method,
args: Array.prototype.slice.call(arguments, 1),
};
}
/**
* OtherService.Yay
*
*
* @returns {Promise<services.Address | null>}
**/
function Yay() {
return wails.Call(OtherService("Yay"));
}
window.go = window.go || {}; window.go = window.go || {};
window.go.services = { window.go.services = {
OtherService: { OtherService: {
Yay,
/**
* OtherService.Yay
*
*
* @returns {Promise<services.Address | null>}
**/
Yay: function() { wails.CallByID(469445984, ...Array.prototype.slice.call(arguments, 0)); },
}, },
}; };

View File

@ -4,491 +4,353 @@
import {main} from './models'; import {main} from './models';
function GreetService(method) {
return {
packageName: "main",
serviceName: "GreetService",
methodName: method,
args: Array.prototype.slice.call(arguments, 1),
};
}
/**
* GreetService.ArrayInt
*
* @param _in {number[]}
* @returns {Promise<void>}
**/
function ArrayInt(_in) {
return wails.Call(GreetService("ArrayInt", _in));
}
/**
* GreetService.BoolInBoolOut
*
* @param _in {boolean}
* @returns {Promise<boolean>}
**/
function BoolInBoolOut(_in) {
return wails.Call(GreetService("BoolInBoolOut", _in));
}
/**
* GreetService.Float32InFloat32Out
*
* @param _in {number}
* @returns {Promise<number>}
**/
function Float32InFloat32Out(_in) {
return wails.Call(GreetService("Float32InFloat32Out", _in));
}
/**
* GreetService.Float64InFloat64Out
*
* @param _in {number}
* @returns {Promise<number>}
**/
function Float64InFloat64Out(_in) {
return wails.Call(GreetService("Float64InFloat64Out", _in));
}
/**
* GreetService.Greet
* Greet someone
* @param name {string}
* @returns {Promise<string>}
**/
function Greet(name) {
return wails.Call(GreetService("Greet", name));
}
/**
* GreetService.Int16InIntOut
*
* @param _in {number}
* @returns {Promise<number>}
**/
function Int16InIntOut(_in) {
return wails.Call(GreetService("Int16InIntOut", _in));
}
/**
* GreetService.Int16PointerInAndOutput
*
* @param _in {number | null}
* @returns {Promise<number | null>}
**/
function Int16PointerInAndOutput(_in) {
return wails.Call(GreetService("Int16PointerInAndOutput", _in));
}
/**
* GreetService.Int32InIntOut
*
* @param _in {number}
* @returns {Promise<number>}
**/
function Int32InIntOut(_in) {
return wails.Call(GreetService("Int32InIntOut", _in));
}
/**
* GreetService.Int32PointerInAndOutput
*
* @param _in {number | null}
* @returns {Promise<number | null>}
**/
function Int32PointerInAndOutput(_in) {
return wails.Call(GreetService("Int32PointerInAndOutput", _in));
}
/**
* GreetService.Int64InIntOut
*
* @param _in {number}
* @returns {Promise<number>}
**/
function Int64InIntOut(_in) {
return wails.Call(GreetService("Int64InIntOut", _in));
}
/**
* GreetService.Int64PointerInAndOutput
*
* @param _in {number | null}
* @returns {Promise<number | null>}
**/
function Int64PointerInAndOutput(_in) {
return wails.Call(GreetService("Int64PointerInAndOutput", _in));
}
/**
* GreetService.Int8InIntOut
*
* @param _in {number}
* @returns {Promise<number>}
**/
function Int8InIntOut(_in) {
return wails.Call(GreetService("Int8InIntOut", _in));
}
/**
* GreetService.Int8PointerInAndOutput
*
* @param _in {number | null}
* @returns {Promise<number | null>}
**/
function Int8PointerInAndOutput(_in) {
return wails.Call(GreetService("Int8PointerInAndOutput", _in));
}
/**
* GreetService.IntInIntOut
*
* @param _in {number}
* @returns {Promise<number>}
**/
function IntInIntOut(_in) {
return wails.Call(GreetService("IntInIntOut", _in));
}
/**
* GreetService.IntPointerInAndOutput
*
* @param _in {number | null}
* @returns {Promise<number | null>}
**/
function IntPointerInAndOutput(_in) {
return wails.Call(GreetService("IntPointerInAndOutput", _in));
}
/**
* GreetService.IntPointerInputNamedOutputs
*
* @param _in {number | null}
* @returns {Promise<number | null, void>}
**/
function IntPointerInputNamedOutputs(_in) {
return wails.Call(GreetService("IntPointerInputNamedOutputs", _in));
}
/**
* GreetService.MapIntInt
*
* @param _in {map}
* @returns {Promise<void>}
**/
function MapIntInt(_in) {
return wails.Call(GreetService("MapIntInt", _in));
}
/**
* GreetService.MapIntPointerInt
*
* @param _in {map}
* @returns {Promise<void>}
**/
function MapIntPointerInt(_in) {
return wails.Call(GreetService("MapIntPointerInt", _in));
}
/**
* GreetService.MapIntSliceInt
*
* @param _in {map}
* @returns {Promise<void>}
**/
function MapIntSliceInt(_in) {
return wails.Call(GreetService("MapIntSliceInt", _in));
}
/**
* GreetService.MapIntSliceIntInMapIntSliceIntOut
*
* @param _in {map}
* @returns {Promise<map>}
**/
function MapIntSliceIntInMapIntSliceIntOut(_in) {
return wails.Call(GreetService("MapIntSliceIntInMapIntSliceIntOut", _in));
}
/**
* GreetService.NoInputsStringOut
*
*
* @returns {Promise<string>}
**/
function NoInputsStringOut() {
return wails.Call(GreetService("NoInputsStringOut"));
}
/**
* GreetService.PointerBoolInBoolOut
*
* @param _in {boolean | null}
* @returns {Promise<boolean | null>}
**/
function PointerBoolInBoolOut(_in) {
return wails.Call(GreetService("PointerBoolInBoolOut", _in));
}
/**
* GreetService.PointerFloat32InFloat32Out
*
* @param _in {number | null}
* @returns {Promise<number | null>}
**/
function PointerFloat32InFloat32Out(_in) {
return wails.Call(GreetService("PointerFloat32InFloat32Out", _in));
}
/**
* GreetService.PointerFloat64InFloat64Out
*
* @param _in {number | null}
* @returns {Promise<number | null>}
**/
function PointerFloat64InFloat64Out(_in) {
return wails.Call(GreetService("PointerFloat64InFloat64Out", _in));
}
/**
* GreetService.PointerMapIntInt
*
* @param _in {map | null}
* @returns {Promise<void>}
**/
function PointerMapIntInt(_in) {
return wails.Call(GreetService("PointerMapIntInt", _in));
}
/**
* GreetService.PointerStringInStringOut
*
* @param _in {string | null}
* @returns {Promise<string | null>}
**/
function PointerStringInStringOut(_in) {
return wails.Call(GreetService("PointerStringInStringOut", _in));
}
/**
* GreetService.StringArrayInputNamedOutput
*
* @param _in {string[]}
* @returns {Promise<string[]>}
**/
function StringArrayInputNamedOutput(_in) {
return wails.Call(GreetService("StringArrayInputNamedOutput", _in));
}
/**
* GreetService.StringArrayInputNamedOutputs
*
* @param _in {string[]}
* @returns {Promise<string[], void>}
**/
function StringArrayInputNamedOutputs(_in) {
return wails.Call(GreetService("StringArrayInputNamedOutputs", _in));
}
/**
* GreetService.StringArrayInputStringArrayOut
*
* @param _in {string[]}
* @returns {Promise<string[]>}
**/
function StringArrayInputStringArrayOut(_in) {
return wails.Call(GreetService("StringArrayInputStringArrayOut", _in));
}
/**
* GreetService.StringArrayInputStringOut
*
* @param _in {string[]}
* @returns {Promise<string>}
**/
function StringArrayInputStringOut(_in) {
return wails.Call(GreetService("StringArrayInputStringOut", _in));
}
/**
* GreetService.StructInputStructOutput
*
* @param _in {main.Person}
* @returns {Promise<main.Person>}
**/
function StructInputStructOutput(_in) {
return wails.Call(GreetService("StructInputStructOutput", _in));
}
/**
* GreetService.StructPointerInputErrorOutput
*
* @param _in {main.Person | null}
* @returns {Promise<void>}
**/
function StructPointerInputErrorOutput(_in) {
return wails.Call(GreetService("StructPointerInputErrorOutput", _in));
}
/**
* GreetService.StructPointerInputStructPointerOutput
*
* @param _in {main.Person | null}
* @returns {Promise<main.Person | null>}
**/
function StructPointerInputStructPointerOutput(_in) {
return wails.Call(GreetService("StructPointerInputStructPointerOutput", _in));
}
/**
* GreetService.UInt16InUIntOut
*
* @param _in {number}
* @returns {Promise<number>}
**/
function UInt16InUIntOut(_in) {
return wails.Call(GreetService("UInt16InUIntOut", _in));
}
/**
* GreetService.UInt16PointerInAndOutput
*
* @param _in {number | null}
* @returns {Promise<number | null>}
**/
function UInt16PointerInAndOutput(_in) {
return wails.Call(GreetService("UInt16PointerInAndOutput", _in));
}
/**
* GreetService.UInt32InUIntOut
*
* @param _in {number}
* @returns {Promise<number>}
**/
function UInt32InUIntOut(_in) {
return wails.Call(GreetService("UInt32InUIntOut", _in));
}
/**
* GreetService.UInt32PointerInAndOutput
*
* @param _in {number | null}
* @returns {Promise<number | null>}
**/
function UInt32PointerInAndOutput(_in) {
return wails.Call(GreetService("UInt32PointerInAndOutput", _in));
}
/**
* GreetService.UInt64InUIntOut
*
* @param _in {number}
* @returns {Promise<number>}
**/
function UInt64InUIntOut(_in) {
return wails.Call(GreetService("UInt64InUIntOut", _in));
}
/**
* GreetService.UInt64PointerInAndOutput
*
* @param _in {number | null}
* @returns {Promise<number | null>}
**/
function UInt64PointerInAndOutput(_in) {
return wails.Call(GreetService("UInt64PointerInAndOutput", _in));
}
/**
* GreetService.UInt8InUIntOut
*
* @param _in {number}
* @returns {Promise<number>}
**/
function UInt8InUIntOut(_in) {
return wails.Call(GreetService("UInt8InUIntOut", _in));
}
/**
* GreetService.UInt8PointerInAndOutput
*
* @param _in {number | null}
* @returns {Promise<number | null>}
**/
function UInt8PointerInAndOutput(_in) {
return wails.Call(GreetService("UInt8PointerInAndOutput", _in));
}
/**
* GreetService.UIntInUIntOut
*
* @param _in {number}
* @returns {Promise<number>}
**/
function UIntInUIntOut(_in) {
return wails.Call(GreetService("UIntInUIntOut", _in));
}
/**
* GreetService.UIntPointerInAndOutput
*
* @param _in {number | null}
* @returns {Promise<number | null>}
**/
function UIntPointerInAndOutput(_in) {
return wails.Call(GreetService("UIntPointerInAndOutput", _in));
}
window.go = window.go || {}; window.go = window.go || {};
window.go.main = { window.go.main = {
GreetService: { GreetService: {
ArrayInt,
BoolInBoolOut, /**
Float32InFloat32Out, * GreetService.ArrayInt
Float64InFloat64Out, *
Greet, * @param _in {number[]}
Int16InIntOut, * @returns {Promise<void>}
Int16PointerInAndOutput, **/
Int32InIntOut, ArrayInt: function(_in) { wails.CallByID(3862002418, ...Array.prototype.slice.call(arguments, 0)); },
Int32PointerInAndOutput,
Int64InIntOut, /**
Int64PointerInAndOutput, * GreetService.BoolInBoolOut
Int8InIntOut, *
Int8PointerInAndOutput, * @param _in {boolean}
IntInIntOut, * @returns {Promise<boolean>}
IntPointerInAndOutput, **/
IntPointerInputNamedOutputs, BoolInBoolOut: function(_in) { wails.CallByID(2424639793, ...Array.prototype.slice.call(arguments, 0)); },
MapIntInt,
MapIntPointerInt, /**
MapIntSliceInt, * GreetService.Float32InFloat32Out
MapIntSliceIntInMapIntSliceIntOut, *
NoInputsStringOut, * @param _in {number}
PointerBoolInBoolOut, * @returns {Promise<number>}
PointerFloat32InFloat32Out, **/
PointerFloat64InFloat64Out, Float32InFloat32Out: function(_in) { wails.CallByID(3132595881, ...Array.prototype.slice.call(arguments, 0)); },
PointerMapIntInt,
PointerStringInStringOut, /**
StringArrayInputNamedOutput, * GreetService.Float64InFloat64Out
StringArrayInputNamedOutputs, *
StringArrayInputStringArrayOut, * @param _in {number}
StringArrayInputStringOut, * @returns {Promise<number>}
StructInputStructOutput, **/
StructPointerInputErrorOutput, Float64InFloat64Out: function(_in) { wails.CallByID(2182412247, ...Array.prototype.slice.call(arguments, 0)); },
StructPointerInputStructPointerOutput,
UInt16InUIntOut, /**
UInt16PointerInAndOutput, * GreetService.Greet
UInt32InUIntOut, * Greet someone
UInt32PointerInAndOutput, * @param name {string}
UInt64InUIntOut, * @returns {Promise<string>}
UInt64PointerInAndOutput, **/
UInt8InUIntOut, Greet: function(name) { wails.CallByID(1411160069, ...Array.prototype.slice.call(arguments, 0)); },
UInt8PointerInAndOutput,
UIntInUIntOut, /**
UIntPointerInAndOutput, * GreetService.Int16InIntOut
*
* @param _in {number}
* @returns {Promise<number>}
**/
Int16InIntOut: function(_in) { wails.CallByID(3306292566, ...Array.prototype.slice.call(arguments, 0)); },
/**
* GreetService.Int16PointerInAndOutput
*
* @param _in {number | null}
* @returns {Promise<number | null>}
**/
Int16PointerInAndOutput: function(_in) { wails.CallByID(1754277916, ...Array.prototype.slice.call(arguments, 0)); },
/**
* GreetService.Int32InIntOut
*
* @param _in {number}
* @returns {Promise<number>}
**/
Int32InIntOut: function(_in) { wails.CallByID(1909469092, ...Array.prototype.slice.call(arguments, 0)); },
/**
* GreetService.Int32PointerInAndOutput
*
* @param _in {number | null}
* @returns {Promise<number | null>}
**/
Int32PointerInAndOutput: function(_in) { wails.CallByID(4251088558, ...Array.prototype.slice.call(arguments, 0)); },
/**
* GreetService.Int64InIntOut
*
* @param _in {number}
* @returns {Promise<number>}
**/
Int64InIntOut: function(_in) { wails.CallByID(1343888303, ...Array.prototype.slice.call(arguments, 0)); },
/**
* GreetService.Int64PointerInAndOutput
*
* @param _in {number | null}
* @returns {Promise<number | null>}
**/
Int64PointerInAndOutput: function(_in) { wails.CallByID(2205561041, ...Array.prototype.slice.call(arguments, 0)); },
/**
* GreetService.Int8InIntOut
*
* @param _in {number}
* @returns {Promise<number>}
**/
Int8InIntOut: function(_in) { wails.CallByID(572240879, ...Array.prototype.slice.call(arguments, 0)); },
/**
* GreetService.Int8PointerInAndOutput
*
* @param _in {number | null}
* @returns {Promise<number | null>}
**/
Int8PointerInAndOutput: function(_in) { wails.CallByID(2189402897, ...Array.prototype.slice.call(arguments, 0)); },
/**
* GreetService.IntInIntOut
*
* @param _in {number}
* @returns {Promise<number>}
**/
IntInIntOut: function(_in) { wails.CallByID(642881729, ...Array.prototype.slice.call(arguments, 0)); },
/**
* GreetService.IntPointerInAndOutput
*
* @param _in {number | null}
* @returns {Promise<number | null>}
**/
IntPointerInAndOutput: function(_in) { wails.CallByID(1066151743, ...Array.prototype.slice.call(arguments, 0)); },
/**
* GreetService.IntPointerInputNamedOutputs
*
* @param _in {number | null}
* @returns {Promise<number | null, void>}
**/
IntPointerInputNamedOutputs: function(_in) { wails.CallByID(2718999663, ...Array.prototype.slice.call(arguments, 0)); },
/**
* GreetService.MapIntInt
*
* @param _in {map}
* @returns {Promise<void>}
**/
MapIntInt: function(_in) { wails.CallByID(2386486356, ...Array.prototype.slice.call(arguments, 0)); },
/**
* GreetService.MapIntPointerInt
*
* @param _in {map}
* @returns {Promise<void>}
**/
MapIntPointerInt: function(_in) { wails.CallByID(550413585, ...Array.prototype.slice.call(arguments, 0)); },
/**
* GreetService.MapIntSliceInt
*
* @param _in {map}
* @returns {Promise<void>}
**/
MapIntSliceInt: function(_in) { wails.CallByID(2900172572, ...Array.prototype.slice.call(arguments, 0)); },
/**
* GreetService.MapIntSliceIntInMapIntSliceIntOut
*
* @param _in {map}
* @returns {Promise<map>}
**/
MapIntSliceIntInMapIntSliceIntOut: function(_in) { wails.CallByID(881980169, ...Array.prototype.slice.call(arguments, 0)); },
/**
* GreetService.NoInputsStringOut
*
*
* @returns {Promise<string>}
**/
NoInputsStringOut: function() { wails.CallByID(1075577233, ...Array.prototype.slice.call(arguments, 0)); },
/**
* GreetService.PointerBoolInBoolOut
*
* @param _in {boolean | null}
* @returns {Promise<boolean | null>}
**/
PointerBoolInBoolOut: function(_in) { wails.CallByID(3589606958, ...Array.prototype.slice.call(arguments, 0)); },
/**
* GreetService.PointerFloat32InFloat32Out
*
* @param _in {number | null}
* @returns {Promise<number | null>}
**/
PointerFloat32InFloat32Out: function(_in) { wails.CallByID(224675106, ...Array.prototype.slice.call(arguments, 0)); },
/**
* GreetService.PointerFloat64InFloat64Out
*
* @param _in {number | null}
* @returns {Promise<number | null>}
**/
PointerFloat64InFloat64Out: function(_in) { wails.CallByID(2124953624, ...Array.prototype.slice.call(arguments, 0)); },
/**
* GreetService.PointerMapIntInt
*
* @param _in {map | null}
* @returns {Promise<void>}
**/
PointerMapIntInt: function(_in) { wails.CallByID(3516977899, ...Array.prototype.slice.call(arguments, 0)); },
/**
* GreetService.PointerStringInStringOut
*
* @param _in {string | null}
* @returns {Promise<string | null>}
**/
PointerStringInStringOut: function(_in) { wails.CallByID(229603958, ...Array.prototype.slice.call(arguments, 0)); },
/**
* GreetService.StringArrayInputNamedOutput
*
* @param _in {string[]}
* @returns {Promise<string[]>}
**/
StringArrayInputNamedOutput: function(_in) { wails.CallByID(3678582682, ...Array.prototype.slice.call(arguments, 0)); },
/**
* GreetService.StringArrayInputNamedOutputs
*
* @param _in {string[]}
* @returns {Promise<string[], void>}
**/
StringArrayInputNamedOutputs: function(_in) { wails.CallByID(319259595, ...Array.prototype.slice.call(arguments, 0)); },
/**
* GreetService.StringArrayInputStringArrayOut
*
* @param _in {string[]}
* @returns {Promise<string[]>}
**/
StringArrayInputStringArrayOut: function(_in) { wails.CallByID(383995060, ...Array.prototype.slice.call(arguments, 0)); },
/**
* GreetService.StringArrayInputStringOut
*
* @param _in {string[]}
* @returns {Promise<string>}
**/
StringArrayInputStringOut: function(_in) { wails.CallByID(1091960237, ...Array.prototype.slice.call(arguments, 0)); },
/**
* GreetService.StructInputStructOutput
*
* @param _in {main.Person}
* @returns {Promise<main.Person>}
**/
StructInputStructOutput: function(_in) { wails.CallByID(3835643147, ...Array.prototype.slice.call(arguments, 0)); },
/**
* GreetService.StructPointerInputErrorOutput
*
* @param _in {main.Person | null}
* @returns {Promise<void>}
**/
StructPointerInputErrorOutput: function(_in) { wails.CallByID(2447692557, ...Array.prototype.slice.call(arguments, 0)); },
/**
* GreetService.StructPointerInputStructPointerOutput
*
* @param _in {main.Person | null}
* @returns {Promise<main.Person | null>}
**/
StructPointerInputStructPointerOutput: function(_in) { wails.CallByID(2943477349, ...Array.prototype.slice.call(arguments, 0)); },
/**
* GreetService.UInt16InUIntOut
*
* @param _in {number}
* @returns {Promise<number>}
**/
UInt16InUIntOut: function(_in) { wails.CallByID(3401034892, ...Array.prototype.slice.call(arguments, 0)); },
/**
* GreetService.UInt16PointerInAndOutput
*
* @param _in {number | null}
* @returns {Promise<number | null>}
**/
UInt16PointerInAndOutput: function(_in) { wails.CallByID(1236957573, ...Array.prototype.slice.call(arguments, 0)); },
/**
* GreetService.UInt32InUIntOut
*
* @param _in {number}
* @returns {Promise<number>}
**/
UInt32InUIntOut: function(_in) { wails.CallByID(1160383782, ...Array.prototype.slice.call(arguments, 0)); },
/**
* GreetService.UInt32PointerInAndOutput
*
* @param _in {number | null}
* @returns {Promise<number | null>}
**/
UInt32PointerInAndOutput: function(_in) { wails.CallByID(1739300671, ...Array.prototype.slice.call(arguments, 0)); },
/**
* GreetService.UInt64InUIntOut
*
* @param _in {number}
* @returns {Promise<number>}
**/
UInt64InUIntOut: function(_in) { wails.CallByID(793803239, ...Array.prototype.slice.call(arguments, 0)); },
/**
* GreetService.UInt64PointerInAndOutput
*
* @param _in {number | null}
* @returns {Promise<number | null>}
**/
UInt64PointerInAndOutput: function(_in) { wails.CallByID(1403757716, ...Array.prototype.slice.call(arguments, 0)); },
/**
* GreetService.UInt8InUIntOut
*
* @param _in {number}
* @returns {Promise<number>}
**/
UInt8InUIntOut: function(_in) { wails.CallByID(2988345717, ...Array.prototype.slice.call(arguments, 0)); },
/**
* GreetService.UInt8PointerInAndOutput
*
* @param _in {number | null}
* @returns {Promise<number | null>}
**/
UInt8PointerInAndOutput: function(_in) { wails.CallByID(518250834, ...Array.prototype.slice.call(arguments, 0)); },
/**
* GreetService.UIntInUIntOut
*
* @param _in {number}
* @returns {Promise<number>}
**/
UIntInUIntOut: function(_in) { wails.CallByID(2836661285, ...Array.prototype.slice.call(arguments, 0)); },
/**
* GreetService.UIntPointerInAndOutput
*
* @param _in {number | null}
* @returns {Promise<number | null>}
**/
UIntPointerInAndOutput: function(_in) { wails.CallByID(1367187362, ...Array.prototype.slice.call(arguments, 0)); },
}, },
}; };

View File

@ -2,28 +2,17 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL // Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT // This file is automatically generated. DO NOT EDIT
function GreetService(method) {
return {
packageName: "main",
serviceName: "GreetService",
methodName: method,
args: Array.prototype.slice.call(arguments, 1),
};
}
/**
* GreetService.Greet
* Greet someone
* @param name {string}
* @returns {Promise<string>}
**/
function Greet(name) {
return wails.Call(GreetService("Greet", name));
}
window.go = window.go || {}; window.go = window.go || {};
window.go.main = { window.go.main = {
GreetService: { GreetService: {
Greet,
/**
* GreetService.Greet
* Greet someone
* @param name {string}
* @returns {Promise<string>}
**/
Greet: function(name) { wails.CallByID(1411160069, ...Array.prototype.slice.call(arguments, 0)); },
}, },
}; };

View File

@ -2,28 +2,17 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL // Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT // This file is automatically generated. DO NOT EDIT
function GreetService(method) {
return {
packageName: "main",
serviceName: "GreetService",
methodName: method,
args: Array.prototype.slice.call(arguments, 1),
};
}
/**
* GreetService.Greet
* Greet someone
* @param name {string}
* @returns {Promise<string>}
**/
function Greet(name) {
return wails.Call(GreetService("Greet", name));
}
window.go = window.go || {}; window.go = window.go || {};
window.go.main = { window.go.main = {
GreetService: { GreetService: {
Greet,
/**
* GreetService.Greet
* Greet someone
* @param name {string}
* @returns {Promise<string>}
**/
Greet: function(name) { wails.CallByID(1411160069, ...Array.prototype.slice.call(arguments, 0)); },
}, },
}; };

View File

@ -4,40 +4,25 @@
import {main} from './models'; import {main} from './models';
function GreetService(method) {
return {
packageName: "main",
serviceName: "GreetService",
methodName: method,
args: Array.prototype.slice.call(arguments, 1),
};
}
/**
* GreetService.Greet
* Greet does XYZ
* @param name {string}
* @returns {Promise<string>}
**/
function Greet(name) {
return wails.Call(GreetService("Greet", name));
}
/**
* GreetService.NewPerson
* NewPerson creates a new person
* @param name {string}
* @returns {Promise<main.Person | null>}
**/
function NewPerson(name) {
return wails.Call(GreetService("NewPerson", name));
}
window.go = window.go || {}; window.go = window.go || {};
window.go.main = { window.go.main = {
GreetService: { GreetService: {
Greet,
NewPerson, /**
* GreetService.Greet
* Greet does XYZ
* @param name {string}
* @returns {Promise<string>}
**/
Greet: function(name) { wails.CallByID(1411160069, ...Array.prototype.slice.call(arguments, 0)); },
/**
* GreetService.NewPerson
* NewPerson creates a new person
* @param name {string}
* @returns {Promise<main.Person | null>}
**/
NewPerson: function(name) { wails.CallByID(1661412647, ...Array.prototype.slice.call(arguments, 0)); },
}, },
}; };

View File

@ -4,29 +4,17 @@
import {services} from './models'; import {services} from './models';
function OtherService(method) {
return {
packageName: "services",
serviceName: "OtherService",
methodName: method,
args: Array.prototype.slice.call(arguments, 1),
};
}
/**
* OtherService.Yay
*
*
* @returns {Promise<services.Address | null>}
**/
function Yay() {
return wails.Call(OtherService("Yay"));
}
window.go = window.go || {}; window.go = window.go || {};
window.go.services = { window.go.services = {
OtherService: { OtherService: {
Yay,
/**
* OtherService.Yay
*
*
* @returns {Promise<services.Address | null>}
**/
Yay: function() { wails.CallByID(302702907, ...Array.prototype.slice.call(arguments, 0)); },
}, },
}; };

View File

@ -1,14 +1,14 @@
package templates package templates
import ( import (
"os"
"testing" "testing"
"github.com/wailsapp/wails/v3/internal/flags" "github.com/wailsapp/wails/v3/internal/flags"
) )
func TestInstall(t *testing.T) { func TestInstall(t *testing.T) {
type args struct {
}
tests := []struct { tests := []struct {
name string name string
options *flags.Init options *flags.Init
@ -25,6 +25,10 @@ func TestInstall(t *testing.T) {
}, },
} }
for _, tt := range tests { for _, tt := range tests {
// Remove test directory if it exists
if _, err := os.Stat(tt.options.ProjectName); err == nil {
_ = os.RemoveAll(tt.options.ProjectName)
}
t.Run(tt.name, func(t *testing.T) { t.Run(tt.name, func(t *testing.T) {
if err := Install(tt.options); (err != nil) != tt.wantErr { if err := Install(tt.options); (err != nil) != tt.wantErr {
t.Errorf("Install() error = %v, wantErr %v", err, tt.wantErr) t.Errorf("Install() error = %v, wantErr %v", err, tt.wantErr)