about summary refs log tree commit diff stats
path: root/baremetal/shell
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-02-09 21:58:17 -0800
committerKartik K. Agaram <vc@akkartik.com>2021-02-09 22:00:02 -0800
commit1969febce5c3043de55b5e28da2f38ca08d17562 (patch)
tree47943b5b14c8f630f24ae8a4cc4c85cfd8b6e6cf /baremetal/shell
parentf3f6bc3f0142dcf06874523e9ac280234d89b501 (diff)
downloadmu-1969febce5c3043de55b5e28da2f38ca08d17562.tar.gz
7707
Diffstat (limited to 'baremetal/shell')
-rw-r--r--baremetal/shell/gap-buffer.mu14
1 files changed, 14 insertions, 0 deletions
diff --git a/baremetal/shell/gap-buffer.mu b/baremetal/shell/gap-buffer.mu
index 0efd1358..56aa9098 100644
--- a/baremetal/shell/gap-buffer.mu
+++ b/baremetal/shell/gap-buffer.mu
@@ -319,6 +319,20 @@ fn test-gap-buffer-equal-from-start {
   check result, "F - test-gap-buffer-equal-from-start"
 }
 
+fn test-gap-buffer-equal-fails {
+  # g = "aaa"
+  var _g: gap-buffer
+  var g/esi: (addr gap-buffer) <- address _g
+  initialize-gap-buffer g
+  var c/eax: grapheme <- copy 0x61/a
+  add-grapheme-at-gap g, c
+  add-grapheme-at-gap g, c
+  add-grapheme-at-gap g, c
+  #
+  var result/eax: boolean <- gap-buffer-equal? g, "aa"
+  check-not result, "F - test-gap-buffer-equal-fails"
+}
+
 fn copy-gap-buffer _src-ah: (addr handle gap-buffer), _dest-ah: (addr handle gap-buffer) {
   # obtain src-a, dest-a
   var src-ah/eax: (addr handle gap-buffer) <- copy _src-ah