about summary refs log tree commit diff stats
path: root/cpp/032string.mu
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/032string.mu')
-rw-r--r--cpp/032string.mu30
1 files changed, 27 insertions, 3 deletions
diff --git a/cpp/032string.mu b/cpp/032string.mu
index 38d9d06f..17608e5f 100644
--- a/cpp/032string.mu
+++ b/cpp/032string.mu
@@ -39,7 +39,7 @@ scenario string-equal-reflexive [
   ]
 ]
 
-scenario string-equal [
+scenario string-equal-identical [
   run [
     default-space:address:space <- new location:type, 30:literal
     x:address:array:character <- new [abc]
@@ -47,11 +47,11 @@ scenario string-equal [
     3:boolean/raw <- string-equal x:address:array:character, y:address:array:character
   ]
   memory should contain [
-    3 <- 1  # abc == abd
+    3 <- 1  # abc == abc
   ]
 ]
 
-scenario string-equal2 [
+scenario string-equal-distinct-lengths [
   run [
     default-space:address:space <- new location:type, 30:literal
     x:address:array:character <- new [abc]
@@ -59,6 +59,30 @@ scenario string-equal2 [
     3:boolean/raw <- string-equal x:address:array:character, y:address:array:character
   ]
   memory should contain [
+    3 <- 0  # abc != abcd
+  ]
+]
+
+scenario string-equal-with-empty [
+  run [
+    default-space:address:space <- new location:type, 30:literal
+    x:address:array:character <- new []
+    y:address:array:character <- new [abcd]
+    3:boolean/raw <- string-equal x:address:array:character, y:address:array:character
+  ]
+  memory should contain [
+    3 <- 0  # "" != abcd
+  ]
+]
+
+scenario string-equal-common-lengths-but-distinct [
+  run [
+    default-space:address:space <- new location:type, 30:literal
+    x:address:array:character <- new [abc]
+    y:address:array:character <- new [abd]
+    3:boolean/raw <- string-equal x:address:array:character, y:address:array:character
+  ]
+  memory should contain [
     3 <- 0  # abc != abd
   ]
 ]