forked from trueagi-io/metta-wam
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f011f3e
commit b74fece
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
tests/baseline_compat/hyperon-mettalog_sanity/rust_tests.metta
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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))) |