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() == "ããããæ¼¢åã«ã"); +}