tests: add regression tests for #288

This commit is contained in:
hellerve 2018-09-18 16:47:16 +02:00
parent bcaf8a6904
commit 3080671967
2 changed files with 23 additions and 0 deletions

3
test/fixture_foo.h Normal file
View File

@ -0,0 +1,3 @@
int fooInit() {
return 1;
}

20
test/regression.carp Normal file
View File

@ -0,0 +1,20 @@
(local-include "../test/fixture_foo.h")
(load "Test.carp")
(load "Vector.carp")
; this is a test-only module to test module resolution (see #288)
(defmodule Foo
(register init (Fn [] Int) "fooInit")
)
(use-all Test Vector2 Foo)
(defn main []
(with-test test
(assert-equal test
1
(init)
"test that the right module gets resolved"
)
)
)