[Kst] kdeextragear-2/kst/tests

George Staikos staikos at kde.org
Wed Dec 15 17:52:52 CET 2004


CVS commit by staikos: 

a couple new testcases that pass


  M +38 -0     testlabelparser.cpp   1.8


--- kdeextragear-2/kst/tests/testlabelparser.cpp  #1.7:1.8
@@ -287,4 +287,42 @@ void doTests() {
   delete parsed;
 
+  parsed = Label::parse("[a][b]");
+  doTest(parsed != 0L);
+  c = parsed->chunk;
+  doTest(c->next != 0L);
+  doTest(c->up == 0L);
+  doTest(c->down == 0L);
+  doTest(c->text == "a");
+  doTest(c->scalar);
+  c = c->next;
+  doTest(c->next == 0L);
+  doTest(c->up == 0L);
+  doTest(c->down == 0L);
+  doTest(c->text == "b");
+  doTest(c->scalar);
+  delete parsed;
+
+  parsed = Label::parse("[a]*[b]");
+  doTest(parsed != 0L);
+  c = parsed->chunk;
+  doTest(c->next != 0L);
+  doTest(c->up == 0L);
+  doTest(c->down == 0L);
+  doTest(c->text == "a");
+  doTest(c->scalar);
+  c = c->next;
+  doTest(c->next != 0L);
+  doTest(c->up == 0L);
+  doTest(c->down == 0L);
+  doTest(c->text == "*");
+  doTest(!c->scalar);
+  c = c->next;
+  doTest(c->next == 0L);
+  doTest(c->up == 0L);
+  doTest(c->down == 0L);
+  doTest(c->text == "b");
+  doTest(c->scalar);
+  delete parsed;
+
   parsed = Label::parse("[x]^[a]_[b][c]");
   doTest(parsed != 0L);





More information about the Kst mailing list