diff --git a/.github/workflows/llgo.yml b/.github/workflows/llgo.yml index 08fe6249..50756e0e 100644 --- a/.github/workflows/llgo.yml +++ b/.github/workflows/llgo.yml @@ -165,6 +165,7 @@ jobs: - name: run llgo test run: | + llgo test ./... cd _demo llgo test -v ./runtest diff --git a/test/c_test.go b/test/c_test.go new file mode 100644 index 00000000..4802d6d1 --- /dev/null +++ b/test/c_test.go @@ -0,0 +1,21 @@ +//go:build llgo +// +build llgo + +package test + +import ( + "testing" + + "github.com/goplus/llgo/c" +) + +// Can't put it in c/ package because it is marked as 'decl' +func TestCstr(t *testing.T) { + cstr := c.Str("foo") + if cstr == nil { + t.Fatal("cstr() returned nil") + } + if c.Strlen(cstr) != 3 { + t.Fatal("cstr() returned invalid length") + } +}