Skip to content

Commit

Permalink
rust / rust! tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrickTench committed Nov 20, 2024
1 parent f011f3e commit b74fece
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 b74fece

Please sign in to comment.