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

Back to archive index

t-suw****@users***** t-suw****@users*****
2007年 9月 12日 (水) 22:45:16 JST


Index: AquaSKK/src/test/Makefile
diff -u AquaSKK/src/test/Makefile:1.1.2.4 AquaSKK/src/test/Makefile:1.1.2.5
--- AquaSKK/src/test/Makefile:1.1.2.4	Tue Sep 11 23:08:20 2007
+++ AquaSKK/src/test/Makefile	Wed Sep 12 22:45:16 2007
@@ -16,7 +16,7 @@
 all: $(LIB) $(PROGS)
 
 test: all
-	for prog in $(PROGS); do ./$$prog; done
+	@for prog in $(PROGS); do ./$$prog; done
 
 clean:
 	$(RM) -rf $(PROGS) $(LIB) *.o .depend
@@ -31,7 +31,7 @@
 	$(CXX) -MM $(CPPFLAGS) $< | sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' > $@
 
 .depend:
-	mkdir .depend
+	@mkdir .depend
 
 ifneq ($(MAKECMDGOALS), clean)
 -include $(addprefix .depend/,$(LIBOBJS:.o=.d) $(OBJS:.o=.d))
Index: AquaSKK/src/test/SKKInputBuffer_TEST.cpp
diff -u /dev/null AquaSKK/src/test/SKKInputBuffer_TEST.cpp:1.1.2.1
--- /dev/null	Wed Sep 12 22:45:16 2007
+++ AquaSKK/src/test/SKKInputBuffer_TEST.cpp	Wed Sep 12 22:45:16 2007
@@ -0,0 +1,50 @@
+#include "SKKInputBuffer.h"
+#include "SKKRomanKanaConverter.h"
+
+int main() {
+    SKKRomanKanaConverter& conv = SKKRomanKanaConverter::theInstance();
+    SKKInputBuffer buffer;
+
+    conv.Initialize("../context/kana-rule-list");
+
+    assert(!buffer.Input('k'));
+    assert(buffer.Input('a') && buffer.InputString() == "" && buffer.FixedString() == "か" && buffer.IsEmpty());
+
+    assert(!buffer.Input('c') && buffer.FixedString() == "" && !buffer.IsEmpty());
+    assert(!buffer.Input('h') && buffer.FixedString() == "" && !buffer.IsEmpty());
+    assert(!buffer.Input('l') && buffer.FixedString() == "l" && buffer.IsEmpty());
+
+    assert(!buffer.Input('z') && buffer.InputString() == "z");
+    assert(buffer.Input('l') && buffer.FixedString() == "→");
+
+    buffer.SelectInputMode(SKK::Katakana);
+    assert(buffer.Input('a') && buffer.FixedString() == "ã‚¢");
+
+    buffer.SelectInputMode(SKK::Jisx0201Kana);
+    assert(buffer.Input('a') && buffer.FixedString() == "ï½±");
+
+    buffer.SelectInputMode(SKK::Jisx0208Latin);
+    assert(buffer.Input('Q') && buffer.FixedString() == "ï¼±");	
+
+    buffer.SelectInputMode(SKK::Ascii);
+    assert(buffer.Input('k') && buffer.FixedString() == "k");
+
+    buffer.SelectInputMode(SKK::Hirakana);
+    buffer.Input('c');
+    buffer.Input('h');
+    buffer.BackSpace();
+    assert(buffer.InputString() == "c" && buffer.FixedString() == "");
+
+    buffer.Input('y');
+    assert(buffer.Input('a') && buffer.IsEmpty() && buffer.FixedString() == "ちゃ");
+
+    buffer.Input('k');
+    buffer.Input('y');
+    buffer.Clear();
+    assert(buffer.IsEmpty());
+
+    buffer.Input('h');
+    buffer.BackSpace();
+    buffer.BackSpace();
+    assert(buffer.IsEmpty());
+}


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