mirror of
https://github.com/go-vikunja/vikunja.git
synced 2026-02-01 22:47:40 +00:00
test(plugins): add yaegi smoke test
This commit is contained in:
1
go.mod
1
go.mod
@@ -167,6 +167,7 @@ require (
|
||||
github.com/subosito/gotenv v1.6.0 // indirect
|
||||
github.com/syndtr/goleveldb v1.0.0 // indirect
|
||||
github.com/tj/assert v0.0.3 // indirect
|
||||
github.com/traefik/yaegi v0.16.1 // indirect
|
||||
github.com/urfave/cli/v2 v2.3.0 // indirect
|
||||
github.com/yosssi/gohtml v0.0.0-20201013000340-ee4748c638f4 // indirect
|
||||
go.uber.org/mock v0.5.0 // indirect
|
||||
|
||||
2
go.sum
2
go.sum
@@ -491,6 +491,8 @@ github.com/tj/assert v0.0.3 h1:Df/BlaZ20mq6kuai7f5z2TvPFiwC3xaWJSDQNiIS3Rk=
|
||||
github.com/tj/assert v0.0.3/go.mod h1:Ne6X72Q+TB1AteidzQncjw9PabbMp4PBMZ1k+vd1Pvk=
|
||||
github.com/tkuchiki/go-timezone v0.2.3 h1:D3TVdIPrFsu9lxGxqNX2wsZwn1MZtTqTW0mdevMozHc=
|
||||
github.com/tkuchiki/go-timezone v0.2.3/go.mod h1:oFweWxYl35C/s7HMVZXiA19Jr9Y0qJHMaG/J2TES4LY=
|
||||
github.com/traefik/yaegi v0.16.1 h1:f1De3DVJqIDKmnasUF6MwmWv1dSEEat0wcpXhD2On3E=
|
||||
github.com/traefik/yaegi v0.16.1/go.mod h1:4eVhbPb3LnD2VigQjhYbEJ69vDRFdT2HQNrXx8eEwUY=
|
||||
github.com/typesense/typesense-go/v2 v2.0.0 h1:+MksOnrVioDqsGpz8RXkOUqhVN+yFxZwJlGDQHr/64I=
|
||||
github.com/typesense/typesense-go/v2 v2.0.0/go.mod h1:7V1ZBSfmdciL6yb2bPtWha+W53gV5WZhyOSpVgDJfao=
|
||||
github.com/ulule/limiter/v3 v3.11.2 h1:P4yOrxoEMJbOTfRJR2OzjL90oflzYPPmWg+dvwN2tHA=
|
||||
|
||||
26
pkg/plugins/yaegi_symbols/stdlib_check_test.go
Normal file
26
pkg/plugins/yaegi_symbols/stdlib_check_test.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package yaegi_symbols
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/traefik/yaegi/interp"
|
||||
"github.com/traefik/yaegi/stdlib"
|
||||
)
|
||||
|
||||
func TestYaegiSmoke(t *testing.T) {
|
||||
i := interp.New(interp.Options{})
|
||||
i.Use(stdlib.Symbols)
|
||||
|
||||
_, err := i.Eval(`import "fmt"`)
|
||||
if err != nil {
|
||||
t.Fatalf("import failed: %v", err)
|
||||
}
|
||||
|
||||
v, err := i.Eval(`fmt.Sprintf("hello %s", "yaegi")`)
|
||||
if err != nil {
|
||||
t.Fatalf("eval failed: %v", err)
|
||||
}
|
||||
if v.String() != "hello yaegi" {
|
||||
t.Fatalf("unexpected result: %s", v.String())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user