Download Jar. Libraryless. Click here for Pure Java version (6175L/44K).
1 | !7 |
2 | |
3 | p-exp {
|
4 | final TArray<O> a = widen(TArray(S)); |
5 | print("Size of empty TArray: " + exclusive_measureSizeOfObject(func { new TArray(S) }));
|
6 | print("Size of empty ArrayList: " + exclusive_measureSizeOfObject(func { new L }));
|
7 | printObjectLayout(a); |
8 | |
9 | a.add("hello");
|
10 | assertTrue(a.contains("hello"));
|
11 | assertEquals("hello", a.get(0));
|
12 | assertEquals(1, l(a)); |
13 | assertException(r { a.add(5); });
|
14 | assertException(r { a.add(null); }); // not allowed either
|
15 | a.remove(0); |
16 | assertEquals(0, l(a)); |
17 | } |
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1018569 |
| Snippet name: | Test TArray (typed array, OK) |
| Eternal ID of this version: | #1018569/11 |
| Text MD5: | 076c30d5900ddd4c00d77674705d5b5b |
| Transpilation MD5: | e4de36c669fdaa41c78166d9acae115f |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX source code (desktop) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2018-10-06 04:47:28 |
| Source code size: | 523 bytes / 17 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 711 / 1780 |
| Version history: | 10 change(s) |
| Referenced in: | [show references] |