[parser] Move context tests into a separate file

This commit is contained in:
stffabi
2024-03-04 12:38:21 +01:00
parent bfe9a9d015
commit 4467a1ffa2
11 changed files with 168 additions and 37 deletions
@@ -0,0 +1,25 @@
// @ts-check
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
import {Call} from '@wailsio/runtime';
/**
* Greet someone
* @function Greet
* @param name {string}
* @returns {Promise<string>}
**/
export async function Greet(name) {
return Call.ByID(1411160069, ...Array.prototype.slice.call(arguments, 0));
}
/**
* Greet someone
* @function GreetWithContext
* @param name {string}
* @returns {Promise<string>}
**/
export async function GreetWithContext(name) {
return Call.ByID(1310150960, ...Array.prototype.slice.call(arguments, 0));
}
@@ -0,0 +1,25 @@
// @ts-check
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
import {Call} from '@wailsio/runtime';
/**
* Greet someone
* @function Greet
* @param name {string}
* @returns {Promise<string>}
**/
export async function Greet(name) {
return Call.ByName("main.GreetService.Greet", ...Array.prototype.slice.call(arguments, 0));
}
/**
* Greet someone
* @function GreetWithContext
* @param name {string}
* @returns {Promise<string>}
**/
export async function GreetWithContext(name) {
return Call.ByName("main.GreetService.GreetWithContext", ...Array.prototype.slice.call(arguments, 0));
}
@@ -0,0 +1,14 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
import {Call} from '@wailsio/runtime';
// Greet someone
export async function Greet(name: string) : Promise<string> {
return Call.ByName("main.GreetService.Greet", name);
}
// Greet someone
export async function GreetWithContext(name: string) : Promise<string> {
return Call.ByName("main.GreetService.GreetWithContext", name);
}
@@ -0,0 +1,14 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
import {Call} from '@wailsio/runtime';
// Greet someone
export async function Greet(name: string) : Promise<string> {
return Call.ByID(1411160069, name);
}
// Greet someone
export async function GreetWithContext(name: string) : Promise<string> {
return Call.ByID(1310150960, name);
}
@@ -0,0 +1,46 @@
package main
import (
"context"
_ "embed"
"log"
"github.com/wailsapp/wails/v3/pkg/application"
)
// GreetService is great
type GreetService struct {
SomeVariable int
lowerCase string
}
// Greet someone
func (*GreetService) Greet(name string) string {
return "Hello " + name
}
// Greet someone
func (*GreetService) GreetWithContext(ctx context.Context, name string) string {
return "Hello " + name
}
func NewGreetService() *GreetService {
return &GreetService{}
}
func main() {
app := application.New(application.Options{
Bind: []interface{}{
NewGreetService(),
},
})
app.NewWebviewWindow()
err := app.Run()
if err != nil {
log.Fatal(err)
}
}