Skip to content

Commit

Permalink
Move test fn scope to kg format
Browse files Browse the repository at this point in the history
  • Loading branch information
briangu committed Nov 30, 2023
1 parent adc9a41 commit 6848402
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 62 deletions.
30 changes: 30 additions & 0 deletions tests/kgtests/language/test_fn_scope.kg
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
:" test_fn_monad_2 "
F::{x,x}
t("F(1)"; F(1); [1 1])

:" test_fn_nested_monad_w_xform "
G::{x};F::{G(4_x)}
t("F(""hello"")"; F("hello"); "o")

:" test_fn_nested_x_scope "
FL:::{};FL,0,{.p(,x@1)};F::{f::FL?0;f(x)}
t("F(""hello"")"; F("hello"); "e")

:" test_nested_x_scope_3 "
G::{.p(,x@0)};F::{G(7_x)}
t("F(""Monkey 0:"")"; F("Monkey 0:"); "0")

:" test_nested_x_scope_compact "
F::{{.p(,x@0)}(7_x)}
t("F(""Monkey 0:"")"; F("Monkey 0:"); "0")

:" test_nested_x_scope_4 "
t("{.p(,x@0)}(7_""Monkey 0:"")"; {.p(,x@0)}(7_"Monkey 0:"); "0")

:" test_nested_x_scope_projection "
UM::{x};G::UM;F::{G(4_x)}
t("F(""hello"")"; F("hello"); "o")

:" test_nested_x_scope_dyad_projection "
UM::{x;y};G::UM("A";);F::{G(4_x)}
t("F(""hello"")"; F("hello"); "o")
11 changes: 9 additions & 2 deletions tests/test_extra_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ class TestExtraCoreSuite(unittest.TestCase):
def assert_eval_cmp(self, a, b, klong=None):
self.assertTrue(eval_cmp(a, b, klong=klong))

@unittest.skip
def test_format2_broadcasting(self):
klong = KlongInterpreter()
r = klong("[1]$[1]")
self.assertTrue(kg_equal(r, ["1"]))

@unittest.skip
def test_append_empty_dictionaries(self):
klong = KlongInterpreter()
Expand All @@ -38,8 +44,9 @@ def test_dict_at_index(self):

@unittest.skip
def test_extra_chars_ignored(self):
# aggs::{[a];a:::{}}}}
pass
klong = KlongInterpreter()
with self.assertRaises(Exception):
klong("aggs::{[a];a:::{}}}}")

@unittest.skip
def test_tested_arity(self):
Expand Down
60 changes: 0 additions & 60 deletions tests/test_fn.py

This file was deleted.

0 comments on commit 6848402

Please sign in to comment.