[aquaskk-changes 372] CVS update: AquaSKK/src/test

Back to archive index

t-suw****@users***** t-suw****@users*****
2007年 9月 16日 (日) 09:15:43 JST


Index: AquaSKK/src/test/Makefile
diff -u AquaSKK/src/test/Makefile:1.1.2.5 AquaSKK/src/test/Makefile:1.1.2.6
--- AquaSKK/src/test/Makefile:1.1.2.5	Wed Sep 12 22:45:16 2007
+++ AquaSKK/src/test/Makefile	Sun Sep 16 09:15:42 2007
@@ -11,7 +11,7 @@
 LDFLAGS	= -L. -ltest
 
 LIBOBJS	= SKKKeymapEntry.o SKKKeymap.o SKKRuleTreeNode.o SKKRomanKanaConverter.o \
-	SKKInputBuffer.o jconv.o
+	SKKInputBuffer.o jconv.o SKKEditBuffer.o
 
 all: $(LIB) $(PROGS)
 
Index: AquaSKK/src/test/SKKEditBuffer_TEST.cpp
diff -u /dev/null AquaSKK/src/test/SKKEditBuffer_TEST.cpp:1.1.2.1
--- /dev/null	Sun Sep 16 09:15:43 2007
+++ AquaSKK/src/test/SKKEditBuffer_TEST.cpp	Sun Sep 16 09:15:42 2007
@@ -0,0 +1,46 @@
+#include "SKKEditBuffer.h"
+
+int main() {
+    SKKEditBuffer buffer;
+
+    assert(buffer.IsEmpty() && buffer.CursorPosition() == 0);
+
+    buffer.Insert("abc");
+    assert(!buffer.IsEmpty());
+
+    buffer.BackSpace();
+    assert(buffer.EditString() == "ab");
+
+    buffer.CursorLeft();
+    buffer.BackSpace();
+    assert(buffer.EditString() == "b");
+
+    buffer.Clear();
+    assert(buffer.IsEmpty());
+
+    buffer.Insert('a');
+    assert(buffer.EditString() == "a");
+
+    buffer.Clear();
+    buffer.Insert("あいうえお漢字!カタカナ");
+
+    buffer.CursorUp();
+    buffer.Delete();
+    assert(buffer.EditString() == "いうえお漢字!カタカナ");
+
+    buffer.CursorDown();
+    buffer.CursorLeft();
+    buffer.CursorLeft();
+    buffer.CursorLeft();
+    buffer.CursorLeft();
+    buffer.CursorLeft();
+    buffer.Delete();
+    assert(buffer.EditString() == "いうえお漢字カタカナ");
+    assert(buffer.CursorPosition() == 6);
+
+    buffer.CursorRight();
+    buffer.CursorRight();
+    buffer.BackSpace();
+    buffer.BackSpace();
+    assert(buffer.EditString() == "いうえお漢字カナ");
+}


aquaskk-changes メーリングリストの案内
Back to archive index