Skip to content

Commit 7130c6c

Browse files
Toad06kmeisthax
authored andcommitted
tests: Remove Value::from_bool
1 parent 39e46e5 commit 7130c6c

File tree

4 files changed

+214
-0
lines changed

4 files changed

+214
-0
lines changed

tests/tests/regression_tests.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,7 @@ swf_tests! {
714714
(string_methods_negative_args, "avm1/string_methods_negative_args", 1),
715715
(string_methods, "avm1/string_methods", 1),
716716
(string_ops_swf6, "avm1/string_ops_swf6", 1),
717+
(swf4_actions_bool, "avm1/swf4_actions_bool", 1),
717718
(swf4_bool, "avm1/swf4_bool", 1),
718719
(swf5_encoding, "avm1/swf5_encoding", 1),
719720
(swf5_no_closure, "avm1/swf5_no_closure", 1),
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
// SWF hand-edited with JPEXS.
2+
3+
4+
trace("// true");
5+
trace(true);
6+
trace("");
7+
trace("// false");
8+
trace(false);
9+
trace("");
10+
trace("");
11+
12+
eq_ = true == "1";
13+
trace("// eq_ = true == '1'");
14+
trace(eq_);
15+
trace("");
16+
trace("// typeof eq_");
17+
trace(typeof eq_);
18+
trace("");
19+
trace("// eq_ === 1");
20+
trace(eq_ === 1);
21+
trace("");
22+
trace("// eq_ === true");
23+
trace(eq_ === true);
24+
trace("");
25+
trace("");
26+
27+
less_ = 3 < 2;
28+
trace("// less_ = 3 < 2");
29+
trace(less_);
30+
trace("");
31+
trace("// typeof less_");
32+
trace(typeof less_);
33+
trace("");
34+
trace("// less_ === 0");
35+
trace(less_ === 0);
36+
trace("");
37+
trace("// less_ === false");
38+
trace(less_ === false);
39+
trace("");
40+
trace("");
41+
42+
and_ = true and "1";
43+
trace("// and_ = true and '1'");
44+
trace(and_);
45+
trace("");
46+
trace("// typeof and_");
47+
trace(typeof and_);
48+
trace("");
49+
trace("// and_ === 1");
50+
trace(and_ === 1);
51+
trace("");
52+
trace("// and_ === true");
53+
trace(and_ === true);
54+
trace("");
55+
trace("");
56+
57+
or_ = true or true;
58+
trace("// or_ = true or true");
59+
trace(or_);
60+
trace("");
61+
trace("// typeof or_");
62+
trace(typeof or_);
63+
trace("");
64+
trace("// or_ === 1");
65+
trace(or_ === 1);
66+
trace("");
67+
trace("// or_ === true");
68+
trace(or_ === true);
69+
trace("");
70+
trace("");
71+
not_ = !"1";
72+
73+
trace("// not_ = !'1'");
74+
trace(not_);
75+
trace("");
76+
trace("// typeof not_");
77+
trace(typeof not_);
78+
trace("");
79+
trace("// not_ === 0");
80+
trace(not_ === 0);
81+
trace("");
82+
trace("// not_ === false");
83+
trace(not_ === false);
84+
trace("");
85+
trace("");
86+
87+
streq_ = "cats" eq "cattle";
88+
trace("// streq_ = 'cats' == 'cattle'");
89+
trace(streq_);
90+
trace("");
91+
trace("// typeof streq_");
92+
trace(typeof streq_);
93+
trace("");
94+
trace("// streq_ === 0");
95+
trace(streq_ === 0);
96+
trace("");
97+
trace("// streq_ === false");
98+
trace(streq_ === false);
99+
trace("");
100+
trace("");
101+
102+
strless_ = "cats" lt "cattle";
103+
trace("// strless_ = 'cats' < 'cattle'");
104+
trace(strless_);
105+
trace("");
106+
trace("// typeof strless_");
107+
trace(typeof strless_);
108+
trace("");
109+
trace("// strless_ === 1");
110+
trace(strless_ === 1);
111+
trace("");
112+
trace("// strless_ === true");
113+
trace(strless_ === true);
114+
trace("");
115+
trace("");
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
// true
2+
1
3+
4+
// false
5+
0
6+
7+
8+
// eq_ = true == '1'
9+
1
10+
11+
// typeof eq_
12+
boolean
13+
14+
// eq_ === 1
15+
0
16+
17+
// eq_ === true
18+
1
19+
20+
21+
// less_ = 3 < 2
22+
0
23+
24+
// typeof less_
25+
boolean
26+
27+
// less_ === 0
28+
0
29+
30+
// less_ === false
31+
1
32+
33+
34+
// and_ = true and '1'
35+
1
36+
37+
// typeof and_
38+
boolean
39+
40+
// and_ === 1
41+
0
42+
43+
// and_ === true
44+
1
45+
46+
47+
// or_ = true or true
48+
1
49+
50+
// typeof or_
51+
boolean
52+
53+
// or_ === 1
54+
0
55+
56+
// or_ === true
57+
1
58+
59+
60+
// not_ = !'1'
61+
0
62+
63+
// typeof not_
64+
boolean
65+
66+
// not_ === 0
67+
0
68+
69+
// not_ === false
70+
1
71+
72+
73+
// streq_ = 'cats' == 'cattle'
74+
0
75+
76+
// typeof streq_
77+
boolean
78+
79+
// streq_ === 0
80+
0
81+
82+
// streq_ === false
83+
1
84+
85+
86+
// strless_ = 'cats' < 'cattle'
87+
1
88+
89+
// typeof strless_
90+
boolean
91+
92+
// strless_ === 1
93+
0
94+
95+
// strless_ === true
96+
1
97+
98+
1.49 KB
Binary file not shown.

0 commit comments

Comments
 (0)