// tests for class TextStyle #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "asserttestexit.h" #include "srchilite/textstyle.h" using namespace std; using namespace srchilite; int main() { string orig = "$text"; string expected = "foo"; string transformed; TextStyle textStyle1(orig); transformed = textStyle1.output("foo", "green"); cout << "orig: " << textStyle1.toString() << endl; cout << "transformed: " << transformed << endl; assertEquals(true, textStyle1.containsStyleVar()); assertEquals(expected, transformed); orig = "$text"; expected = "foo"; textStyle1 = TextStyle(orig); transformed = textStyle1.output("foo", "green"); cout << "orig: " << textStyle1.toString() << endl; cout << "transformed: " << transformed << endl; assertEquals(false, textStyle1.containsStyleVar()); assertEquals(expected, transformed); TextStyle inner("$text"); TextStyle composed = textStyle1.compose(inner); transformed = composed.output("foo"); cout << "orig:" << composed.toString() << endl; cout << "transformed: " << transformed << endl; assertEquals("foo", transformed); expected = "(\\foo)"; textStyle1 = TextStyle(); transformed = textStyle1.output("(\\foo)", "green"); cout << "orig: " << textStyle1.toString() << endl; cout << "transformed: " << transformed << endl; assertEquals(expected, transformed); cout << "test_textstyle: SUCCESS!" << endl; return 0; }

AltStyle によって変換されたページ (->オリジナル) /