From 1969febce5c3043de55b5e28da2f38ca08d17562 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Tue, 9 Feb 2021 21:58:17 -0800 Subject: 7707 --- baremetal/shell/gap-buffer.mu | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'baremetal/shell') 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 -- cgit 1.4.1-2-gfad0