[Kst] extragear/graphics/kst/tests

George Staikos staikos at kde.org
Thu Dec 15 18:05:02 CET 2005


SVN commit 488728 by staikos:

adapt testcases to label parser behavior changes


 M  +6 -8      testlabelparser.cpp  


--- trunk/extragear/graphics/kst/tests/testlabelparser.cpp #488727:488728
@@ -63,7 +63,7 @@
   doTest(parsed != 0L);
   doTest(parsed->chunk->prev == 0L);
   doTest(parsed->chunk->next == 0L);
-  doTest(parsed->chunk->text == "t");
+  doTest(parsed->chunk->text == QChar(0x3A4 + 0x20));
   doTest(parsed->chunk->vOffset == Label::Chunk::None);
   delete parsed;
 
@@ -84,7 +84,9 @@
   parsed = Label::parse("\\tau\\Theta");
   doTest(parsed != 0L);
   doTest(parsed->chunk->next == 0L);
-  doTest(parsed->chunk->text == "tQ");
+  doTest(parsed->chunk->text[0] == QChar(0x3A4 + 0x20));
+  doTest(parsed->chunk->text[1] == QChar(0x398));
+  doTest(parsed->chunk->text.length() == 2);
   delete parsed;
 
   Label::Chunk *c = 0L;
@@ -93,20 +95,16 @@
   doTest(parsed != 0L);
   c = parsed->chunk;
   doTest(c->next != 0L);
-  doTest(c->text == "t");
+  doTest(c->text == QString(QChar(0x3A4 + 0x20)) + "foo bar");
   c = c->next;
   doTest(c->prev != 0L);
   doTest(c->next != 0L);
-  doTest(c->text == "foo bar");
-  c = c->next;
-  doTest(c->prev != 0L);
-  doTest(c->next != 0L);
   doTest(c->text == "");
   doTest(c->linebreak == true);
   c = c->next;
   doTest(c->prev != 0L);
   doTest(c->next == 0L);
-  doTest(c->text == "Q");
+  doTest(c->text == QChar(0x398));
   delete parsed;
 
   parsed = Label::parse("x^y^z");


More information about the Kst mailing list