summaryrefslogtreecommitdiffstats
path: root/PerlTQt/t/b_nogui.t
diff options
context:
space:
mode:
authorTimothy Pearson <[email protected]>2012-01-01 18:29:30 -0600
committerTimothy Pearson <[email protected]>2012-01-01 18:29:30 -0600
commitb2af005db21bd8fd068cb79b2ae700953128af2c (patch)
treeabd0ed633726bf0bbecb57d30e92836c31e02695 /PerlTQt/t/b_nogui.t
parentc1b9383f2032d82db5eb8918dca885e37a901dde (diff)
downloadlibtqt-perl-b2af005db21bd8fd068cb79b2ae700953128af2c.tar.gz
libtqt-perl-b2af005db21bd8fd068cb79b2ae700953128af2c.zip
Move PerlQt
Diffstat (limited to 'PerlTQt/t/b_nogui.t')
-rw-r--r--PerlTQt/t/b_nogui.t48
1 files changed, 48 insertions, 0 deletions
diff --git a/PerlTQt/t/b_nogui.t b/PerlTQt/t/b_nogui.t
new file mode 100644
index 0000000..cd28260
--- /dev/null
+++ b/PerlTQt/t/b_nogui.t
@@ -0,0 +1,48 @@
+
+BEGIN { print "1..6\n" }
+
+use TQt;
+use TQt::constants;
+
+eval {my $c = TQt::TextCodec::codecForLocale()};
+
+print +$@ ? "not ok\n" : "ok 1\n";
+
+eval {my $s = TQt::Variant( TQt::DateTime::currentDateTime() ) };
+
+print +$@ ? "not ok\n" : "ok 2\n";
+
+my $ret;
+eval {$ret = TQt::Point(20,20); $ret += TQt::Point(10,10); $ret *= 2 ; $ret /= 3 };
+
+print +$@ ? "not ok\n" : "ok 3\n";
+
+eval { $ret = ($ret->x != 20 or $ret->y != 20) ? 1 : 0 };
+
+print +($@ || $ret) ? "not ok\n" : "ok 4\n";
+
+eval { my $z = TQt::GlobalSpace::qVersion() };
+
+if( $@ )
+{
+ print "ok 5 # skip Smoke version too old\n";
+ print "ok 6 # skip Smoke version too old\n";
+}
+else
+{
+ eval{ my $p = TQt::Point( 20, 20 );
+ my $p2 = TQt::Point( 30, 30 );
+ $p = $p + $p2 + $p;
+ $p2 = $p * 2;
+ $p2 = -$p2;
+ $ret = ($p2->x != -140 or $p2->y != -140) ? 1 : 0
+ };
+ print +($@ || $ret) ? "not ok\n" : "ok 5\n";
+
+ eval {
+ $str = "Fooooooooooo";
+ $ts = TQt::TextStream( $str, IO_WriteOnly );
+ $ts << "pi = " << 3.14;
+ };
+ print +($str eq "pi = 3.14ooo") ? "ok 6\n":"not ok\n";
+}