Skip to content

Commit

Permalink
fixes after Vitaly's review
Browse files Browse the repository at this point in the history
  • Loading branch information
Innokenty committed Dec 28, 2024
1 parent 5f50553 commit 64933ea
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 0 additions & 2 deletions python/tests/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,8 +368,6 @@ def test_char_vs_string(self):
self.assertEqual(repr(metta.run('!("A")')), '[[("A")]]')
self.assertEqualMettaRunnerResults(metta.run("!(get-type 'A')"), [[S('Char')]])
self.assertEqualMettaRunnerResults(metta.run('!(get-type "A")'), [[S('String')]])
self.assertEqual(metta.run('!(repr "A")')[0][0].get_object(), ValueObject("\"A\""))


class SomeObject():

Expand Down
4 changes: 4 additions & 0 deletions python/tests/test_grounded_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ def test_higher_func(self):
self.assertEqual(metta.run("!((curry_num plus 1) 2)"),
metta.run("! 3"))

def test_string_repr(self):
metta = MeTTa(env_builder=Environment.test_env())
self.assertEqual(metta.run('!(repr "A")')[0][0].get_object(), ValueObject("\"A\""))

def test_meta_types(self):
metta = MeTTa(env_builder=Environment.test_env())
### Basic functional types
Expand Down
4 changes: 2 additions & 2 deletions python/tests/test_stdlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ def test_text_ops(self):
#self.assertEqualMettaRunnerResults(metta.run('!(parse "$X")'),
# [[(V("X"))]])

self.assertEqualMettaRunnerResults(metta.run('!(parse "\\"A\\"")'),
[[(ValueAtom("A"))]])
self.assertEqualMettaRunnerResults(repr(metta.run('!(parse "\\"A\\"")')),
'[[\\"A\\"]]')

#self.assertEqualMettaRunnerResults(metta.run('!(parse "(func (Cons $x (Cons $xs $xss))) ")'),
# [[E(S("func"), E(S("Cons"), V("x"), E(S("Cons"), V("xs"), V("xss"))))]])
Expand Down

0 comments on commit 64933ea

Please sign in to comment.