Add new tests for avm2 string.split()

This commit is contained in:
Adrian Wielgosik 2021-08-13 17:02:29 +02:00 committed by Adrian Wielgosik
parent cfb2bb99d6
commit 5dee7f163c
4 changed files with 36 additions and 0 deletions

View File

@ -570,6 +570,7 @@ swf_tests! {
(as3_string_length, "avm2/string_length", 1), (as3_string_length, "avm2/string_length", 1),
(as3_string_char_at, "avm2/string_char_at", 1), (as3_string_char_at, "avm2/string_char_at", 1),
(as3_string_char_code_at, "avm2/string_char_code_at", 1), (as3_string_char_code_at, "avm2/string_char_code_at", 1),
(as3_string_split, "avm2/string_split", 1),
(as3_typeof, "avm2/typeof", 1), (as3_typeof, "avm2/typeof", 1),
(use_hand_cursor, "avm1/use_hand_cursor", 1), (use_hand_cursor, "avm1/use_hand_cursor", 1),
(as3_movieclip_displayevents, "avm2/movieclip_displayevents", 9), (as3_movieclip_displayevents, "avm2/movieclip_displayevents", 9),

View File

@ -0,0 +1,9 @@
// var text = "a.b.c";
// text.split("a.b.c")
,
// text.split(".")
a,b,c
// text.split("")
a,.,b,.,c
// text.split() - unimplemented
// text.split(regex) - unimplemented

View File

@ -0,0 +1,26 @@
package {
import flash.display.MovieClip;
public class Test extends MovieClip {
public function Test() {
// note: compiled manually with AIR SDK
trace('// var text = "a.b.c";');
var text = "a.b.c";
trace('// text.split("a.b.c")');
trace(text.split("a.b.c"));
trace('// text.split(".")');
trace(text.split("."));
trace('// text.split("")');
trace(text.split(""));
trace('// text.split() - unimplemented');
trace('// text.split(regex) - unimplemented');
}
}
}

Binary file not shown.