diff --git a/core/tests/regression_tests.rs b/core/tests/regression_tests.rs index 57e310028..918d15a61 100644 --- a/core/tests/regression_tests.rs +++ b/core/tests/regression_tests.rs @@ -160,6 +160,7 @@ swf_tests! { (slash_syntax, "avm1/slash_syntax", 2), (strictequals_swf6, "avm1/strictequals_swf6", 1), (string_methods, "avm1/string_methods", 1), + (string_ops_swf6, "avm1/string_ops_swf6", 1), (path_string, "avm1/path_string", 1), (global_is_bare, "avm1/global_is_bare", 1), (primitive_type_globals, "avm1/primitive_type_globals", 1), diff --git a/core/tests/swfs/avm1/string_ops_swf6/output.txt b/core/tests/swfs/avm1/string_ops_swf6/output.txt new file mode 100644 index 000000000..c2483ed19 --- /dev/null +++ b/core/tests/swfs/avm1/string_ops_swf6/output.txt @@ -0,0 +1,95 @@ +// length +// length("foo") +3 +// mblength() +3 +// length("") +0 +// mblength("") +0 +// length("😋") +2 +// mblength("😋") +2 +// length("😋Спасибо𝌆𝌆hello") +18 +// mblength("😋Спасибо𝌆𝌆hello") +18 + +// ord("f") +102 +// mbord("f") +102 +// ord("bar") +98 +// mbord("bar") +98 +// ord(null) +110 +// mbord(null) +110 +// ord("愛") +24859 +// mbord("愛") +24859 + +// ord("😋") +65533 +// mbord("😋") +65533 +// chr(80) +P +// mbchr(80) +P +// chr(12345) +〹 +// chr(12345) +〹 +// chr(65616) +P +// mbchr(65616) +P +// chr(-65456) +P +// mbchr(-65456) +P +// chr(0xd801) +� +// mbchr(0xd801) +� +// chr(0xabababab) +ꮫ +// mbchr(0xabababab) +ꮫ +// chr(null) + +// mbchr(null) + +// chr(true) + +// mbchr(true) + +// substring(s, 1, 2) +😋 +// mbsubstring(s, 1, 2) +😋 +// substring(s, 3, 1) +航 +// mbsubstring(s, 3, 1) +航 +// substring(s, 0, 2) +😋 +// mbsubstring(s, 0, 2) +😋 +// substring(s, -5, -100) +😋航空母艦testing! +// mbsubstring(s, -5, -100) +😋航空母艦testing! +// substring(s, 2, 0) + +// mbsubstring(s, 2, 0) + +// substring(s, 4294967303, -4294967294) +te +// mbsubstring(s, 4294967303, -4294967294) +te diff --git a/core/tests/swfs/avm1/string_ops_swf6/test.fla b/core/tests/swfs/avm1/string_ops_swf6/test.fla new file mode 100644 index 000000000..c06642472 Binary files /dev/null and b/core/tests/swfs/avm1/string_ops_swf6/test.fla differ diff --git a/core/tests/swfs/avm1/string_ops_swf6/test.swf b/core/tests/swfs/avm1/string_ops_swf6/test.swf new file mode 100644 index 000000000..f3ad41c72 Binary files /dev/null and b/core/tests/swfs/avm1/string_ops_swf6/test.swf differ