We now have a current svn snapshot of libqxt in our contrib dir, and
[quassel.git] / src / contrib / libqxt-2007-10-24 / tests / web / htmltemplate / main.cpp
diff --git a/src/contrib/libqxt-2007-10-24/tests/web/htmltemplate/main.cpp b/src/contrib/libqxt-2007-10-24/tests/web/htmltemplate/main.cpp
new file mode 100644 (file)
index 0000000..34d57cb
--- /dev/null
@@ -0,0 +1,32 @@
+#include <QTest>
+#include <QSignalSpy>
+#include <QxtHtmlTemplate>
+class Test: public QObject
+{
+Q_OBJECT 
+private slots:
+    void simple()
+    { 
+        QxtHtmlTemplate t;
+        t.load("<?=foo?>");
+        t["foo"]="bla";
+        QVERIFY(t.render()=="bla");
+    }
+    void surounded()
+    { 
+        QxtHtmlTemplate t;
+        t.load("123456789<?=foo?>123456789");
+        t["foo"]="heyJO";
+        QVERIFY(t.render()=="123456789heyJO123456789");
+    }
+    void indented()
+    { 
+        QxtHtmlTemplate t;
+        t.load("\n       <?=foo?>");
+        t["foo"]="baz\nbar";
+        QVERIFY(t.render()=="\n       baz\n       bar");
+    }
+};
+
+QTEST_MAIN(Test)
+#include "main.moc"