diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-02-08 16:20:53 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-02-08 16:20:53 -0800 |
commit | c405cf2b73c5062a786d9ad2ef8920db4952efed (patch) | |
tree | 4cef49b75bb8091ee45a5302ee93f9b1165a4501 | |
parent | 8d82da3c775e5223e2cb2d70ff6c75c9139c90bc (diff) | |
download | mu-c405cf2b73c5062a786d9ad2ef8920db4952efed.tar.gz |
2640 - fix some tests
Thanks Caleb Couch for finding this. These tests were breaking only when some other code somewhere has already triggered the specialization of 'append' for numbers. How to test this? Perhaps the right fix is to warn when character variants are used with literals. Or only when there's also a generic variant that could conceivably be specialized for numbers.
-rw-r--r-- | 070text.mu | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/070text.mu b/070text.mu index 3afabfe9..56291b75 100644 --- a/070text.mu +++ b/070text.mu @@ -209,14 +209,18 @@ scenario buffer-append-works [ local-scope x:address:shared:buffer <- new-buffer 3 s1:address:shared:array:character <- get *x, data:offset - x <- append x, 97 # 'a' - x <- append x, 98 # 'b' - x <- append x, 99 # 'c' + c:character <- copy 97/a + x <- append x, c + c:character <- copy 98/b + x <- append x, c + c:character <- copy 99/c + x <- append x, c s2:address:shared:array:character <- get *x, data:offset 1:boolean/raw <- equal s1, s2 2:array:character/raw <- copy *s2 +buffer-filled - x <- append x, 100 # 'd' + c:character <- copy 100/d + x <- append x, c s3:address:shared:array:character <- get *x, data:offset 10:boolean/raw <- equal s1, s3 11:number/raw <- get *x, length:offset @@ -246,9 +250,12 @@ scenario buffer-append-handles-backspace [ run [ local-scope x:address:shared:buffer <- new-buffer 3 - x <- append x, 97 # 'a' - x <- append x, 98 # 'b' - x <- append x, 8/backspace + c:character <- copy 97/a + x <- append x, c + c:character <- copy 98/b + x <- append x, c + c:character <- copy 8/backspace + x <- append x, c s:address:shared:array:character <- buffer-to-array x 1:array:character/raw <- copy *s ] |