tests: Add a test for the `delete` operator

This commit is contained in:
David Wendt 2021-03-12 22:27:52 -05:00 committed by kmeisthax
parent f3cf82ad5a
commit f6ea1b2bff
4 changed files with 33 additions and 0 deletions

View File

@ -0,0 +1,22 @@
package {
public class Test {
}
}
trace("/// var a: Vector.<int> = new <int>[2,3];");
var a:Vector.<int> = new <int>[2,3];
trace(a[0]);
trace(a[1]);
trace("/// delete a[0];");
trace(delete a[0]);
trace(a[0]);
trace(a[1]);
trace("/// delete a[1];");
trace(delete a[1]);
trace(a[0]);
trace(a[1]);

View File

@ -0,0 +1,11 @@
/// var a: Vector.<int> = new <int>[2,3];
2
3
/// delete a[0];
true
2
3
/// delete a[1];
true
2
3

Binary file not shown.

Binary file not shown.