about summary refs log tree commit diff stats
path: root/cpp/060string.mu
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/060string.mu')
-rw-r--r--cpp/060string.mu17
1 files changed, 17 insertions, 0 deletions
diff --git a/cpp/060string.mu b/cpp/060string.mu
index 8f64b67f..a0d2757d 100644
--- a/cpp/060string.mu
+++ b/cpp/060string.mu
@@ -204,12 +204,29 @@ scenario buffer-append-works [
 #?     $print [
 #? ]
     2:array:character/raw <- copy s2:address:array:character/deref
+    +buffer-filled
+    x:address:buffer <- buffer-append x:address:buffer, 100:literal  # 'd'
+    s3:address:array:character <- get x:address:buffer/deref, data:offset
+    10:boolean/raw <- equal s1:address:array:character, s3:address:array:character
+    11:integer/raw <- get x:address:buffer/deref, length:offset
+    12:array:character/raw <- copy s3:address:array:character/deref
   ]
   memory should contain [
+    # before +buffer-filled
     1 <- 1   # no change in data pointer
     2 <- 3   # size of data
     3 <- 97  # data
     4 <- 98
     5 <- 99
+    # in the end
+    10 <- 0   # data pointer has grown
+    11 <- 4   # final length
+    12 <- 6   # but data's capacity has doubled
+    13 <- 97  # data
+    14 <- 98
+    15 <- 99
+    16 <- 100
+    17 <- 0
+    18 <- 0
   ]
 ]