-
Notifications
You must be signed in to change notification settings - Fork 24
/
list_test.go
41 lines (39 loc) · 748 Bytes
/
list_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package gscript
import "testing"
func TestLinkedList(t *testing.T) {
script := `
LinkedList list = LinkedList();
list.add("1");
list.add("2");
list.add("3");
list.dump();
println("size= "+ list.getSize());
assertEqual(list.getSize(), 3);
`
NewCompiler().Compiler(script)
}
func TestLinkedLis2(t *testing.T) {
script := `
int count =100;
LinkedList list = LinkedList();
for (int i=0;i<count;i++){
string key = i+"";
list.add(key);
}
list.dump();
assertEqual(list.getSize(), 100);
`
NewCompiler().Compiler(script)
}
func TestLinkedLis3Any(t *testing.T) {
script := `
int count =100;
LinkedList list = LinkedList();
for (int i=0;i<count;i++){
list.add(i);
}
list.dump();
assertEqual(list.getSize(), 100);
`
NewCompiler().Compiler(script)
}