about summary refs log tree commit diff stats
path: root/cpp/.traces/buffer-append-works
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-05-02 15:52:22 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-05-02 22:56:13 -0700
commit22b3069272c1a177e814a7c4e769e20858e2b368 (patch)
tree761199b26823fe5ba11af66108e95ece1bc4f02c /cpp/.traces/buffer-append-works
parenta316f1e4168a98ba8c1bbe7b091f8a7e7b3f03e6 (diff)
downloadmu-22b3069272c1a177e814a7c4e769e20858e2b368.tar.gz
1242 - simpler implementation for 'scenario'
Also now has the side effect that scenarios can have any number of 'run'
or check or any future blocks, in any order.
Diffstat (limited to 'cpp/.traces/buffer-append-works')
-rw-r--r--cpp/.traces/buffer-append-works275
1 files changed, 258 insertions, 17 deletions
diff --git a/cpp/.traces/buffer-append-works b/cpp/.traces/buffer-append-works
index 0cad1113..9cadf18c 100644
--- a/cpp/.traces/buffer-append-works
+++ b/cpp/.traces/buffer-append-works
@@ -1,3 +1,196 @@
+parse/0: instruction: run
+parse/0:   ingredient: {name: "
+    default-space:address:array:location <- new location:type, 30:literal
+    x:address:buffer <- init-buffer 3:literal
+    s1:address:array:character <- get x:address:buffer/deref, data:offset
+    x:address:buffer <- buffer-append x:address:buffer, 97:literal  # 'a'
+    x:address:buffer <- buffer-append x:address:buffer, 98:literal  # 'b'
+    x:address:buffer <- buffer-append x:address:buffer, 99:literal  # 'c'
+    s2:address:array:character <- get x:address:buffer/deref, data:offset
+    1:boolean/raw <- equal s1:address:array:character, s2:address:array:character
+#?     $print s2:address:array:character
+#?     $print [
+#? ]
+#?     $print 1060:integer/raw
+#?     $print [
+#? ]
+#?     $print 1061:integer/raw
+#?     $print [
+#? ]
+#?     $print 1062:integer/raw
+#?     $print [
+#? ]
+#?     $print 1063:integer/raw
+#?     $print [
+#? ]
+#?     $print 1064:integer/raw
+#?     $print [
+#? ]
+#?     $print 1065:integer/raw
+#?     $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
+  ", value: 0, type: 0, properties: ["
+    default-space:address:array:location <- new location:type, 30:literal
+    x:address:buffer <- init-buffer 3:literal
+    s1:address:array:character <- get x:address:buffer/deref, data:offset
+    x:address:buffer <- buffer-append x:address:buffer, 97:literal  # 'a'
+    x:address:buffer <- buffer-append x:address:buffer, 98:literal  # 'b'
+    x:address:buffer <- buffer-append x:address:buffer, 99:literal  # 'c'
+    s2:address:array:character <- get x:address:buffer/deref, data:offset
+    1:boolean/raw <- equal s1:address:array:character, s2:address:array:character
+#?     $print s2:address:array:character
+#?     $print [
+#? ]
+#?     $print 1060:integer/raw
+#?     $print [
+#? ]
+#?     $print 1061:integer/raw
+#?     $print [
+#? ]
+#?     $print 1062:integer/raw
+#?     $print [
+#? ]
+#?     $print 1063:integer/raw
+#?     $print [
+#? ]
+#?     $print 1064:integer/raw
+#?     $print [
+#? ]
+#?     $print 1065:integer/raw
+#?     $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
+  ": "literal-string"]}
+parse/0: instruction: memory-should-contain
+parse/0:   ingredient: {name: "
+    # 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
+  ", value: 0, type: 0, properties: ["
+    # 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
+  ": "literal-string"]}
+after-brace/0: recipe buffer-append-works
+after-brace/0: run ...
+after-brace/0: memory-should-contain ...
+new/0: routine allocated memory from 1000 to 101000
+schedule/0: buffer-append-works
+run/0: instruction buffer-append-works/0
+run/0: run {name: "
+    default-space:address:array:location <- new location:type, 30:literal
+    x:address:buffer <- init-buffer 3:literal
+    s1:address:array:character <- get x:address:buffer/deref, data:offset
+    x:address:buffer <- buffer-append x:address:buffer, 97:literal  # 'a'
+    x:address:buffer <- buffer-append x:address:buffer, 98:literal  # 'b'
+    x:address:buffer <- buffer-append x:address:buffer, 99:literal  # 'c'
+    s2:address:array:character <- get x:address:buffer/deref, data:offset
+    1:boolean/raw <- equal s1:address:array:character, s2:address:array:character
+#?     $print s2:address:array:character
+#?     $print [
+#? ]
+#?     $print 1060:integer/raw
+#?     $print [
+#? ]
+#?     $print 1061:integer/raw
+#?     $print [
+#? ]
+#?     $print 1062:integer/raw
+#?     $print [
+#? ]
+#?     $print 1063:integer/raw
+#?     $print [
+#? ]
+#?     $print 1064:integer/raw
+#?     $print [
+#? ]
+#?     $print 1065:integer/raw
+#?     $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
+  ", value: 0, type: 0, properties: ["
+    default-space:address:array:location <- new location:type, 30:literal
+    x:address:buffer <- init-buffer 3:literal
+    s1:address:array:character <- get x:address:buffer/deref, data:offset
+    x:address:buffer <- buffer-append x:address:buffer, 97:literal  # 'a'
+    x:address:buffer <- buffer-append x:address:buffer, 98:literal  # 'b'
+    x:address:buffer <- buffer-append x:address:buffer, 99:literal  # 'c'
+    s2:address:array:character <- get x:address:buffer/deref, data:offset
+    1:boolean/raw <- equal s1:address:array:character, s2:address:array:character
+#?     $print s2:address:array:character
+#?     $print [
+#? ]
+#?     $print 1060:integer/raw
+#?     $print [
+#? ]
+#?     $print 1061:integer/raw
+#?     $print [
+#? ]
+#?     $print 1062:integer/raw
+#?     $print [
+#? ]
+#?     $print 1063:integer/raw
+#?     $print [
+#? ]
+#?     $print 1064:integer/raw
+#?     $print [
+#? ]
+#?     $print 1065:integer/raw
+#?     $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
+  ": "literal-string"]}
 parse/0: instruction: new
 parse/0:   ingredient: {name: "location", value: 0, type: 0, properties: ["location": "type"]}
 parse/0:   ingredient: {name: "30", value: 0, type: 0, properties: ["30": "literal"]}
@@ -61,7 +254,7 @@ name/0: assign s2 3
 name/0: element data of type buffer is at offset 1
 name/0: assign s3 4
 name/0: element length of type buffer is at offset 0
-after-brace/0: recipe test-buffer-append-works
+after-brace/0: recipe tmp0
 after-brace/0: new ...
 after-brace/0: init-buffer ...
 after-brace/0: get ...
@@ -76,13 +269,11 @@ after-brace/0: get ...
 after-brace/0: equal ...
 after-brace/0: get ...
 after-brace/0: copy ...
-new/0: routine allocated memory from 1000 to 101000
-schedule/0: test-buffer-append-works
-run/0: instruction test-buffer-append-works/0
+run/0: instruction tmp0/0
 run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]}
 mem/0: array size is 30
 mem/0: new alloc: 1000
-run/0: instruction test-buffer-append-works/1
+run/0: instruction tmp0/1
 run/0: {name: "x", value: 1, type: 2-9, properties: ["x": "address":"buffer"]} <- init-buffer {name: "3", value: 3, type: 0, properties: ["3": "literal"]}
 run/0: instruction init-buffer/0
 run/0: {name: "default-space", value: 0, type: 2-5-1, properties: ["default-space": "address":"array":"location"]} <- new {name: "location", value: 1, type: 0, properties: ["location": "type"]}, {name: "30", value: 30, type: 0, properties: ["30": "literal"]}
@@ -129,7 +320,7 @@ run/0: reply {name: "result", value: 1, type: 2-9, properties: ["result": "addre
 mem/0: location 1033 is 1062
 run/0: result 0 is 1062
 mem/0: storing 1062 in location 1002
-run/0: instruction test-buffer-append-works/2
+run/0: instruction tmp0/2
 run/0: {name: "s1", value: 2, type: 2-5-4, properties: ["s1": "address":"array":"character"]} <- get {name: "x", value: 1, type: 2-9, properties: ["x": "address":"buffer", "deref": ]}, {name: "data", value: 1, type: 0, properties: ["data": "offset"]}
 run/0: ingredient 0 is x
 mem/0: location 1002 is 1062
@@ -139,7 +330,7 @@ run/0: its type is 2
 mem/0: location 1063 is 1064
 run/0: product 0 is 1064
 mem/0: storing 1064 in location 1003
-run/0: instruction test-buffer-append-works/3
+run/0: instruction tmp0/3
 run/0: {name: "x", value: 1, type: 2-9, properties: ["x": "address":"buffer"]} <- buffer-append {name: "x", value: 1, type: 2-9, properties: ["x": "address":"buffer"]}, {name: "97", value: 97, type: 0, properties: ["97": "literal"]}
 mem/0: location 1002 is 1062
 run/0: instruction buffer-append/0
@@ -256,7 +447,7 @@ run/0: reply {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buf
 mem/0: location 1070 is 1062
 run/0: result 0 is 1062
 mem/0: storing 1062 in location 1002
-run/0: instruction test-buffer-append-works/4
+run/0: instruction tmp0/4
 run/0: {name: "x", value: 1, type: 2-9, properties: ["x": "address":"buffer"]} <- buffer-append {name: "x", value: 1, type: 2-9, properties: ["x": "address":"buffer"]}, {name: "98", value: 98, type: 0, properties: ["98": "literal"]}
 mem/0: location 1002 is 1062
 run/0: instruction buffer-append/0
@@ -373,7 +564,7 @@ run/0: reply {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buf
 mem/0: location 1132 is 1062
 run/0: result 0 is 1062
 mem/0: storing 1062 in location 1002
-run/0: instruction test-buffer-append-works/5
+run/0: instruction tmp0/5
 run/0: {name: "x", value: 1, type: 2-9, properties: ["x": "address":"buffer"]} <- buffer-append {name: "x", value: 1, type: 2-9, properties: ["x": "address":"buffer"]}, {name: "99", value: 99, type: 0, properties: ["99": "literal"]}
 mem/0: location 1002 is 1062
 run/0: instruction buffer-append/0
@@ -490,7 +681,7 @@ run/0: reply {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buf
 mem/0: location 1194 is 1062
 run/0: result 0 is 1062
 mem/0: storing 1062 in location 1002
-run/0: instruction test-buffer-append-works/6
+run/0: instruction tmp0/6
 run/0: {name: "s2", value: 3, type: 2-5-4, properties: ["s2": "address":"array":"character"]} <- get {name: "x", value: 1, type: 2-9, properties: ["x": "address":"buffer", "deref": ]}, {name: "data", value: 1, type: 0, properties: ["data": "offset"]}
 run/0: ingredient 0 is x
 mem/0: location 1002 is 1062
@@ -500,7 +691,7 @@ run/0: its type is 2
 mem/0: location 1063 is 1064
 run/0: product 0 is 1064
 mem/0: storing 1064 in location 1004
-run/0: instruction test-buffer-append-works/7
+run/0: instruction tmp0/7
 run/0: {name: "1", value: 1, type: 3, properties: ["1": "boolean", "raw": ]} <- equal {name: "s1", value: 2, type: 2-5-4, properties: ["s1": "address":"array":"character"]}, {name: "s2", value: 3, type: 2-5-4, properties: ["s2": "address":"array":"character"]}
 run/0: ingredient 0 is s1
 mem/0: location 1003 is 1064
@@ -508,7 +699,7 @@ run/0: ingredient 1 is s2
 mem/0: location 1004 is 1064
 run/0: product 0 is 1
 mem/0: storing 1 in location 1
-run/0: instruction test-buffer-append-works/8
+run/0: instruction tmp0/8
 run/0: {name: "2", value: 2, type: 5-4, properties: ["2": "array":"character", "raw": ]} <- copy {name: "s2", value: 3, type: 2-5-4, properties: ["s2": "address":"array":"character", "deref": ]}
 run/0: ingredient 0 is s2
 mem/0: location 1004 is 1064
@@ -520,7 +711,7 @@ mem/0: storing 3 in location 2
 mem/0: storing 97 in location 3
 mem/0: storing 98 in location 4
 mem/0: storing 99 in location 5
-run/0: instruction test-buffer-append-works/10
+run/0: instruction tmp0/10
 run/0: {name: "x", value: 1, type: 2-9, properties: ["x": "address":"buffer"]} <- buffer-append {name: "x", value: 1, type: 2-9, properties: ["x": "address":"buffer"]}, {name: "100", value: 100, type: 0, properties: ["100": "literal"]}
 mem/0: location 1002 is 1062
 run/0: instruction buffer-append/0
@@ -857,7 +1048,7 @@ run/0: reply {name: "in", value: 1, type: 2-9, properties: ["in": "address":"buf
 mem/0: location 1256 is 1062
 run/0: result 0 is 1062
 mem/0: storing 1062 in location 1002
-run/0: instruction test-buffer-append-works/11
+run/0: instruction tmp0/11
 run/0: {name: "s3", value: 4, type: 2-5-4, properties: ["s3": "address":"array":"character"]} <- get {name: "x", value: 1, type: 2-9, properties: ["x": "address":"buffer", "deref": ]}, {name: "data", value: 1, type: 0, properties: ["data": "offset"]}
 run/0: ingredient 0 is x
 mem/0: location 1002 is 1062
@@ -867,7 +1058,7 @@ run/0: its type is 2
 mem/0: location 1063 is 1347
 run/0: product 0 is 1347
 mem/0: storing 1347 in location 1005
-run/0: instruction test-buffer-append-works/12
+run/0: instruction tmp0/12
 run/0: {name: "10", value: 10, type: 3, properties: ["10": "boolean", "raw": ]} <- equal {name: "s1", value: 2, type: 2-5-4, properties: ["s1": "address":"array":"character"]}, {name: "s3", value: 4, type: 2-5-4, properties: ["s3": "address":"array":"character"]}
 run/0: ingredient 0 is s1
 mem/0: location 1003 is 1064
@@ -875,7 +1066,7 @@ run/0: ingredient 1 is s3
 mem/0: location 1005 is 1347
 run/0: product 0 is 0
 mem/0: storing 0 in location 10
-run/0: instruction test-buffer-append-works/13
+run/0: instruction tmp0/13
 run/0: {name: "11", value: 11, type: 1, properties: ["11": "integer", "raw": ]} <- get {name: "x", value: 1, type: 2-9, properties: ["x": "address":"buffer", "deref": ]}, {name: "length", value: 0, type: 0, properties: ["length": "offset"]}
 run/0: ingredient 0 is x
 mem/0: location 1002 is 1062
@@ -885,7 +1076,7 @@ run/0: its type is 1
 mem/0: location 1062 is 4
 run/0: product 0 is 4
 mem/0: storing 4 in location 11
-run/0: instruction test-buffer-append-works/14
+run/0: instruction tmp0/14
 run/0: {name: "12", value: 12, type: 5-4, properties: ["12": "array":"character", "raw": ]} <- copy {name: "s3", value: 4, type: 2-5-4, properties: ["s3": "address":"array":"character", "deref": ]}
 run/0: ingredient 0 is s3
 mem/0: location 1005 is 1347
@@ -903,3 +1094,53 @@ mem/0: storing 99 in location 15
 mem/0: storing 100 in location 16
 mem/0: storing 0 in location 17
 mem/0: storing 0 in location 18
+run/0: instruction buffer-append-works/1
+run/0: memory-should-contain {name: "
+    # 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
+  ", value: 0, type: 0, properties: ["
+    # 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
+  ": "literal-string"]}
+run/0: checking location 1
+run/0: checking location 2
+run/0: checking location 3
+run/0: checking location 4
+run/0: checking location 5
+run/0: checking location 10
+run/0: checking location 11
+run/0: checking location 12
+run/0: checking location 13
+run/0: checking location 14
+run/0: checking location 15
+run/0: checking location 16
+run/0: checking location 17
+run/0: checking location 18