diff options
-rw-r--r-- | 061text.mu | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/061text.mu b/061text.mu index 1ba93f75..6d0fb082 100644 --- a/061text.mu +++ b/061text.mu @@ -122,6 +122,11 @@ def new-buffer capacity:number -> result:address:buffer [ load-ingredients result <- new buffer:type *result <- put *result, length:offset, 0 + { + break-if capacity + # capacity not provided + capacity <- copy 10 + } data:address:array:character <- new character:type, capacity *result <- put *result, data:offset, data return result @@ -242,6 +247,15 @@ scenario buffer-append-works [ ] ] +scenario buffer-append-to-empty [ + run [ + local-scope + x:address:buffer <- new-buffer + c:character <- copy 97/a + x <- append x, c + ] +] + scenario buffer-append-handles-backspace [ run [ local-scope |