tests: Remove `Value::from_bool`

This commit is contained in:
Toad06 2022-05-19 18:05:45 +02:00 committed by kmeisthax
parent 39e46e5bd3
commit 7130c6c1c1
4 changed files with 214 additions and 0 deletions

View File

@ -714,6 +714,7 @@ swf_tests! {
(string_methods_negative_args, "avm1/string_methods_negative_args", 1),
(string_methods, "avm1/string_methods", 1),
(string_ops_swf6, "avm1/string_ops_swf6", 1),
(swf4_actions_bool, "avm1/swf4_actions_bool", 1),
(swf4_bool, "avm1/swf4_bool", 1),
(swf5_encoding, "avm1/swf5_encoding", 1),
(swf5_no_closure, "avm1/swf5_no_closure", 1),

View File

@ -0,0 +1,115 @@
// SWF hand-edited with JPEXS.
trace("// true");
trace(true);
trace("");
trace("// false");
trace(false);
trace("");
trace("");
eq_ = true == "1";
trace("// eq_ = true == '1'");
trace(eq_);
trace("");
trace("// typeof eq_");
trace(typeof eq_);
trace("");
trace("// eq_ === 1");
trace(eq_ === 1);
trace("");
trace("// eq_ === true");
trace(eq_ === true);
trace("");
trace("");
less_ = 3 < 2;
trace("// less_ = 3 < 2");
trace(less_);
trace("");
trace("// typeof less_");
trace(typeof less_);
trace("");
trace("// less_ === 0");
trace(less_ === 0);
trace("");
trace("// less_ === false");
trace(less_ === false);
trace("");
trace("");
and_ = true and "1";
trace("// and_ = true and '1'");
trace(and_);
trace("");
trace("// typeof and_");
trace(typeof and_);
trace("");
trace("// and_ === 1");
trace(and_ === 1);
trace("");
trace("// and_ === true");
trace(and_ === true);
trace("");
trace("");
or_ = true or true;
trace("// or_ = true or true");
trace(or_);
trace("");
trace("// typeof or_");
trace(typeof or_);
trace("");
trace("// or_ === 1");
trace(or_ === 1);
trace("");
trace("// or_ === true");
trace(or_ === true);
trace("");
trace("");
not_ = !"1";
trace("// not_ = !'1'");
trace(not_);
trace("");
trace("// typeof not_");
trace(typeof not_);
trace("");
trace("// not_ === 0");
trace(not_ === 0);
trace("");
trace("// not_ === false");
trace(not_ === false);
trace("");
trace("");
streq_ = "cats" eq "cattle";
trace("// streq_ = 'cats' == 'cattle'");
trace(streq_);
trace("");
trace("// typeof streq_");
trace(typeof streq_);
trace("");
trace("// streq_ === 0");
trace(streq_ === 0);
trace("");
trace("// streq_ === false");
trace(streq_ === false);
trace("");
trace("");
strless_ = "cats" lt "cattle";
trace("// strless_ = 'cats' < 'cattle'");
trace(strless_);
trace("");
trace("// typeof strless_");
trace(typeof strless_);
trace("");
trace("// strless_ === 1");
trace(strless_ === 1);
trace("");
trace("// strless_ === true");
trace(strless_ === true);
trace("");
trace("");

View File

@ -0,0 +1,98 @@
// true
1
// false
0
// eq_ = true == '1'
1
// typeof eq_
boolean
// eq_ === 1
0
// eq_ === true
1
// less_ = 3 < 2
0
// typeof less_
boolean
// less_ === 0
0
// less_ === false
1
// and_ = true and '1'
1
// typeof and_
boolean
// and_ === 1
0
// and_ === true
1
// or_ = true or true
1
// typeof or_
boolean
// or_ === 1
0
// or_ === true
1
// not_ = !'1'
0
// typeof not_
boolean
// not_ === 0
0
// not_ === false
1
// streq_ = 'cats' == 'cattle'
0
// typeof streq_
boolean
// streq_ === 0
0
// streq_ === false
1
// strless_ = 'cats' < 'cattle'
1
// typeof strless_
boolean
// strless_ === 1
0
// strless_ === true
1

Binary file not shown.