fix llgo test unit test

This commit is contained in:
Li Jie
2025-04-03 16:20:09 +08:00
parent 8c5f915569
commit c8d791f206
9 changed files with 6 additions and 7 deletions

View File

@@ -0,0 +1,5 @@
package bar
func Bar() int {
return 2
}

View File

@@ -0,0 +1,9 @@
package bar
import "testing"
func TestBar(t *testing.T) {
if Bar() != 2 {
t.Fatal("Bar() != 2")
}
}

View File

@@ -0,0 +1,5 @@
package foo
func Foo() int {
return 1
}

View File

@@ -0,0 +1,9 @@
package foo
import "testing"
func TestFoo(t *testing.T) {
if Foo() != 1 {
t.Fatal("Foo() != 1")
}
}

View File

@@ -0,0 +1,16 @@
package main
import (
"github.com/goplus/llgo/cl/_testgo/runtest/bar"
"github.com/goplus/llgo/cl/_testgo/runtest/foo"
)
func Zoo() int {
return 3
}
func main() {
println("foo.Foo()", foo.Foo())
println("bar.Bar()", bar.Bar())
println("Zoo()", Zoo())
}

View File

@@ -0,0 +1,13 @@
package main
import "testing"
func TestZoo(t *testing.T) {
if Zoo() != 3 {
t.Fatal("Zoo() != 3")
}
}
func TestFalse(t *testing.T) {
// t.Fatal("false")
}

View File

@@ -0,0 +1 @@
;