Skip to content

Commit

Permalink
Merge pull request #198 from AdrickTench/main
Browse files Browse the repository at this point in the history
tests for rust + rust!
  • Loading branch information
TeamSPoon authored Nov 21, 2024
2 parents f07c12a + 41edad3 commit 2b98c4c
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/baseline_compat/hyperon-mettalog_sanity/rust_tests.metta
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
;; Basic evaluation

!(assertEqualToResult (rust !(+ 1 2)) (3))
!(assertEqualToResult (rust! (+ 1 2)) (3))

;; Rust uses a separate atomspace

;; Match

!(assertEqualToResult (rust (likes John Jane)) ())
!(assertEqualToResult (rust !(match &self (likes John $who) $who)) (Jane))
!(assertEqualToResult (rust! (match &self (likes John $who) $who)) (Jane))
!(assertEqualToResult (match &self (likes John $who) $who) ())

;; Function evaluation

!(assertEqualToResult (rust (= (foo $x) (+ $x 1))) ())
!(assertEqualToResult (rust !(foo 1)) (2))
!(assertEqualToResult (rust! (foo 1)) (2))
!(assertEqualToResult (foo 1) ((foo 1)))

0 comments on commit 2b98c4c

Please sign in to comment.