Skip to content

Commit

Permalink
tests: Add avm1/text_format_display test
Browse files Browse the repository at this point in the history
This test verifies the behavior of TextFormat.display.
  • Loading branch information
kjarosh committed Jan 31, 2025
1 parent e7699ec commit 2d3bafa
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/tests/swfs/avm1/text_format_display/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Default
block
Various values
block
block
block
block
block
block
block
Proper values
inline
block
none
block
Resetting to null
inline
block
Resetting to undefined
inline
block
42 changes: 42 additions & 0 deletions tests/tests/swfs/avm1/text_format_display/test.as
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
var tf = new TextFormat();

trace("Default");
trace(tf.display);

trace("Various values");
tf.display = '';
trace(tf.display);
tf.display = 'x';
trace(tf.display);
tf.display = new Object();
trace(tf.display);
tf.display = 1;
trace(tf.display);
tf.display = 0;
trace(tf.display);
tf.display = null;
trace(tf.display);
tf.display = undefined;
trace(tf.display);

trace("Proper values");
tf.display = 'inline';
trace(tf.display);
tf.display = 'block';
trace(tf.display);
tf.display = 'none';
trace(tf.display);
tf.display = 'Inline';
trace(tf.display);

trace("Resetting to null");
tf.display = 'inline';
trace(tf.display);
tf.display = null;
trace(tf.display);

trace("Resetting to undefined");
tf.display = 'inline';
trace(tf.display);
tf.display = undefined;
trace(tf.display);
Binary file added tests/tests/swfs/avm1/text_format_display/test.swf
Binary file not shown.
1 change: 1 addition & 0 deletions tests/tests/swfs/avm1/text_format_display/test.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
num_frames = 1

0 comments on commit 2d3bafa

Please sign in to comment.