[goalc] add a build system (#704)

* add first attempt at build system

* fix stupid bug

* try again
This commit is contained in:
water111
2021-07-15 21:37:15 -04:00
committed by GitHub
parent 77667d9185
commit ef011f4fe8
33 changed files with 2208 additions and 72 deletions
+4
View File
@@ -115,6 +115,10 @@ std::vector<std::string> get_test_pass_string(const std::string& name, int count
}
} // namespace
TEST_F(WithGameTests, MakeSystem) {
compiler.run_front_end_on_string("(make \"out/iso/ENGINE.CGO\")");
}
TEST_F(WithGameTests, ReturnConstant) {
runner.run_static_test(env, testCategory, "defun-return-constant.static.gc", {"12\n"});
}
+14
View File
@@ -1319,3 +1319,17 @@ TEST(GoosBuiltins, Error) {
Interpreter i;
EXPECT_ANY_THROW(e(i, "(error \"hi\")"));
}
TEST(GoosBuiltins, Ash) {
Interpreter i;
EXPECT_EQ(e(i, "(ash 3 2)"), "12");
EXPECT_EQ(e(i, "(ash 3 -1)"), "1");
}
TEST(GoosBuiltins, StringUtils) {
Interpreter i;
EXPECT_EQ(e(i, "(string-ref \"test\" 2)"), "#\\s");
EXPECT_EQ(e(i, "(string-length \"test\")"), "4");
EXPECT_EQ(e(i, "(string-append \"hello\" \" \" \"world\")"), "\"hello world\"");
EXPECT_EQ(e(i, "(symbol->string 'test)"), "\"test\"");
}