about summary refs log tree commit diff stats
path: root/cpp/032string.mu
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-04-06 12:02:38 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-04-06 12:04:03 -0700
commitad8e984fd4590740cb6dc23e951848108f671aac (patch)
tree04c9c51d4506a6add01308b127d1819efdfade2c /cpp/032string.mu
parentcc3b58b6370f27fb3fb600d6538a542c2fe44d36 (diff)
downloadmu-ad8e984fd4590740cb6dc23e951848108f671aac.tar.gz
1024 - basic skeleton for running scenarios
For now every scenario parses to the same dummy scenario.
Diffstat (limited to 'cpp/032string.mu')
-rw-r--r--cpp/032string.mu35
1 files changed, 35 insertions, 0 deletions
diff --git a/cpp/032string.mu b/cpp/032string.mu
index eff288eb..38d9d06f 100644
--- a/cpp/032string.mu
+++ b/cpp/032string.mu
@@ -27,3 +27,38 @@ recipe string-equal [
   }
   reply 1:literal
 ]
+
+scenario string-equal-reflexive [
+  run [
+    default-space:address:space <- new location:type, 30:literal
+    x:address:array:character <- new [abc]
+    3:boolean/raw <- string-equal x:address:array:character, x:address:array:character
+  ]
+  memory should contain [
+    3 <- 1  # x == x for all x
+  ]
+]
+
+scenario string-equal [
+  run [
+    default-space:address:space <- new location:type, 30:literal
+    x:address:array:character <- new [abc]
+    y:address:array:character <- new [abc]
+    3:boolean/raw <- string-equal x:address:array:character, y:address:array:character
+  ]
+  memory should contain [
+    3 <- 1  # abc == abd
+  ]
+]
+
+scenario string-equal2 [
+  run [
+    default-space:address:space <- new location:type, 30:literal
+    x:address:array:character <- new [abc]
+    y:address:array:character <- new [abcd]
+    3:boolean/raw <- string-equal x:address:array:character, y:address:array:character
+  ]
+  memory should contain [
+    3 <- 0  # abc != abd
+  ]
+]