Line 0
Link Here
|
|
|
1 |
--- t/17sqlfxml-producer.t.orig Sun May 9 20:51:50 2004 |
2 |
+++ t/17sqlfxml-producer.t Sun May 9 20:55:44 2004 |
3 |
@@ -8,7 +8,10 @@ |
4 |
|
5 |
use strict; |
6 |
use Test::More; |
7 |
-use Test::Exception; |
8 |
+use vars '$no_test_exception'; |
9 |
+$no_test_exception = 0; |
10 |
+eval { require Test::Exception; }; |
11 |
+$no_test_exception = $@; |
12 |
|
13 |
use Data::Dumper; |
14 |
my %opt; |
15 |
@@ -149,7 +152,12 @@ |
16 |
from => 'MySQL', |
17 |
to => 'XML-SQLFairy', |
18 |
); |
19 |
-lives_ok {$xml = $obj->translate($file);} "Translate (emit_empty_tags=>0) ran"; |
20 |
+if ($no_test_exception) { |
21 |
+ $xml = $obj->translate($file); |
22 |
+ pass "Translate (emit_empty_tags=>0) ran"; |
23 |
+} else { |
24 |
+ lives_ok {$xml = $obj->translate($file);} "Translate (emit_empty_tags=>0) ran"; |
25 |
+} |
26 |
ok("$xml" ne "" ,"Produced something!"); |
27 |
print "XML:\n$xml" if DEBUG; |
28 |
# Strip sqlf header with its variable date so we diff safely |
29 |
@@ -270,7 +278,12 @@ |
30 |
to => 'XML-SQLFairy', |
31 |
producer_args => { emit_empty_tags => 1 }, |
32 |
); |
33 |
-lives_ok { $xml=$obj->translate($file); } "Translate (emit_empty_tags=>1) ran"; |
34 |
+if ($no_test_exception) { |
35 |
+ $xml=$obj->translate($file); |
36 |
+ pass "Translate (emit_empty_tags=>1) ran"; |
37 |
+} else { |
38 |
+ lives_ok { $xml=$obj->translate($file); } "Translate (emit_empty_tags=>1) ran"; |
39 |
+} |
40 |
ok("$xml" ne "" ,"Produced something!"); |
41 |
print "XML emit_empty_tags=>1:\n$xml" if DEBUG; |
42 |
# Strip sqlf header with its variable date so we diff safely |
43 |
@@ -314,7 +327,12 @@ |
44 |
to => "XML-SQLFairy", |
45 |
producer_args => { attrib_values => 1 }, |
46 |
); |
47 |
-lives_ok {$xml = $obj->translate($file);} "Translate (attrib_values=>1) ran"; |
48 |
+if ($no_test_exception) { |
49 |
+ $xml = $obj->translate($file); |
50 |
+ pass "Translate (attrib_values=>1) ran"; |
51 |
+} else { |
52 |
+ lives_ok {$xml = $obj->translate($file);} "Translate (attrib_values=>1) ran"; |
53 |
+} |
54 |
ok("$xml" ne "" ,"Produced something!"); |
55 |
print "XML attrib_values=>1:\n$xml" if DEBUG; |
56 |
# Strip sqlf header with its variable date so we diff safely |
57 |
@@ -364,7 +382,12 @@ |
58 |
|
59 |
# As we have created a Schema we give translate a dummy string so that |
60 |
# it will run the produce. |
61 |
- lives_ok {$xml =$obj->translate("FOO");} "Translate (View) ran"; |
62 |
+ if ($no_test_exception) { |
63 |
+ $xml =$obj->translate("FOO"); |
64 |
+ pass "Translate (View) ran"; |
65 |
+ } else { |
66 |
+ lives_ok {$xml =$obj->translate("FOO");} "Translate (View) ran"; |
67 |
+ } |
68 |
ok("$xml" ne "" ,"Produced something!"); |
69 |
print "XML attrib_values=>1:\n$xml" if DEBUG; |
70 |
# Strip sqlf header with its variable date so we diff safely |
71 |
@@ -418,7 +441,12 @@ |
72 |
|
73 |
# As we have created a Schema we give translate a dummy string so that |
74 |
# it will run the produce. |
75 |
- lives_ok {$xml =$obj->translate("FOO");} "Translate (Trigger) ran"; |
76 |
+ if ($no_test_exception) { |
77 |
+ $xml =$obj->translate("FOO"); |
78 |
+ pass "Translate (Trigger) ran"; |
79 |
+ } else { |
80 |
+ lives_ok {$xml =$obj->translate("FOO");} "Translate (Trigger) ran"; |
81 |
+ } |
82 |
ok("$xml" ne "" ,"Produced something!"); |
83 |
print "XML attrib_values=>1:\n$xml" if DEBUG; |
84 |
# Strip sqlf header with its variable date so we diff safely |
85 |
@@ -472,7 +500,12 @@ |
86 |
|
87 |
# As we have created a Schema we give translate a dummy string so that |
88 |
# it will run the produce. |
89 |
- lives_ok {$xml =$obj->translate("FOO");} "Translate (Procedure) ran"; |
90 |
+ if ($no_test_exception) { |
91 |
+ $xml =$obj->translate("FOO"); |
92 |
+ pass "Translate (Procedure) ran"; |
93 |
+ } else { |
94 |
+ lives_ok {$xml =$obj->translate("FOO");} "Translate (Procedure) ran"; |
95 |
+ } |
96 |
ok("$xml" ne "" ,"Produced something!"); |
97 |
print "XML attrib_values=>1:\n$xml" if DEBUG; |
98 |
# Strip sqlf header with its variable date so we diff safely |