From f34c111c2d02a682bbb80c3b533ee939c84e2a51 Mon Sep 17 00:00:00 2001 From: FelixBrendel Date: Mon, 10 Feb 2020 15:38:13 +0100 Subject: [PATCH] test debugging --- 3rd/ftb | 2 +- bin/tests/modules.slime | 13 +++++++++++++ src/eval.cpp | 5 +---- src/memory.cpp | 2 +- src/testing.cpp | 23 +++++++++++++---------- 5 files changed, 29 insertions(+), 16 deletions(-) create mode 100644 bin/tests/modules.slime diff --git a/3rd/ftb b/3rd/ftb index 7b128b3..60e3253 160000 --- a/3rd/ftb +++ b/3rd/ftb @@ -1 +1 @@ -Subproject commit 7b128b33c97060bb5a76be8d969d5318fb2cf65c +Subproject commit 60e32530367957861d503d2b6228d650d7f3b6ac diff --git a/bin/tests/modules.slime b/bin/tests/modules.slime new file mode 100644 index 0000000..0e6b126 --- /dev/null +++ b/bin/tests/modules.slime @@ -0,0 +1,13 @@ +;; (define-module math +;; :exports +;; (pi tau pow sqrt) + +;; (define pi 3.1415) +;; (define tau (* 2 pi)) +;; (define (pow a b) (** a b)) +;; (define (sqrt a) (** a 0.5))) + +;; (assert (= math::pi 3.1415)) +;; (assert (= math::tau (* 2 math::tau))) + +(1 2 3) diff --git a/src/eval.cpp b/src/eval.cpp index a0b1841..f7f4284 100644 --- a/src/eval.cpp +++ b/src/eval.cpp @@ -18,9 +18,6 @@ namespace Slime { // - setting the parent environment // - setting the arg_spec // - potentially evaluating the arguments - if (arg_count == 0) { - return new_env; - } // NOTE(Felix): Even though we will return the environment at the // end, for defining symbols here for the parameters, it has to be @@ -691,7 +688,7 @@ namespace Slime { for (auto am : ams) { printf("%d\n ", am); } - pause(); + // pause(); }; proc push_pc_on_cs = [&] { diff --git a/src/memory.cpp b/src/memory.cpp index afb61ea..eddf6b4 100644 --- a/src/memory.cpp +++ b/src/memory.cpp @@ -500,7 +500,7 @@ namespace Slime::Memory { }; try load_built_ins_into_environment(); - // try built_in_load(Memory::create_string("pre.slime")); + try built_in_load(Memory::create_string("pre.slime")); return ret; } diff --git a/src/testing.cpp b/src/testing.cpp index b371d82..047888d 100644 --- a/src/testing.cpp +++ b/src/testing.cpp @@ -620,17 +620,20 @@ namespace Slime { // pop_environment(); printf("\n-- Test Files --\n"); - invoke_test_script("evaluation_of_default_args"); - invoke_test_script("alists"); - invoke_test_script("case_and_cond"); - invoke_test_script("lexical_scope"); + // invoke_test_script("evaluation_of_default_args"); + // invoke_test_script("case_and_cond"); + // invoke_test_script("lexical_scope"); + // invoke_test_script("singular_imports"); + // invoke_test_script("hashmaps"); + // invoke_test_script("import_and_load"); + // invoke_test_script("macro_expand"); + // invoke_test_script("sicp"); + invoke_test_script("modules"); + + invoke_test_script("class_macro"); - invoke_test_script("import_and_load"); - invoke_test_script("macro_expand"); - invoke_test_script("automata"); - invoke_test_script("sicp"); - invoke_test_script("hashmaps"); - invoke_test_script("singular_imports"); + // invoke_test_script("automata"); + // invoke_test_script("alists"); return result; }