fix llgo test unit test
This commit is contained in:
5
cl/_testgo/runtest/bar/bar.go
Normal file
5
cl/_testgo/runtest/bar/bar.go
Normal file
@@ -0,0 +1,5 @@
|
||||
package bar
|
||||
|
||||
func Bar() int {
|
||||
return 2
|
||||
}
|
||||
9
cl/_testgo/runtest/bar/bar_test.go
Normal file
9
cl/_testgo/runtest/bar/bar_test.go
Normal file
@@ -0,0 +1,9 @@
|
||||
package bar
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestBar(t *testing.T) {
|
||||
if Bar() != 2 {
|
||||
t.Fatal("Bar() != 2")
|
||||
}
|
||||
}
|
||||
5
cl/_testgo/runtest/foo/foo.go
Normal file
5
cl/_testgo/runtest/foo/foo.go
Normal file
@@ -0,0 +1,5 @@
|
||||
package foo
|
||||
|
||||
func Foo() int {
|
||||
return 1
|
||||
}
|
||||
9
cl/_testgo/runtest/foo/foo_test.go
Normal file
9
cl/_testgo/runtest/foo/foo_test.go
Normal file
@@ -0,0 +1,9 @@
|
||||
package foo
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestFoo(t *testing.T) {
|
||||
if Foo() != 1 {
|
||||
t.Fatal("Foo() != 1")
|
||||
}
|
||||
}
|
||||
16
cl/_testgo/runtest/main.go
Normal file
16
cl/_testgo/runtest/main.go
Normal 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())
|
||||
}
|
||||
13
cl/_testgo/runtest/main_test.go
Normal file
13
cl/_testgo/runtest/main_test.go
Normal 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")
|
||||
}
|
||||
1
cl/_testgo/runtest/out.ll
Normal file
1
cl/_testgo/runtest/out.ll
Normal file
@@ -0,0 +1 @@
|
||||
;
|
||||
Reference in New Issue
Block a user