-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_list.c
48 lines (38 loc) · 1.02 KB
/
test_list.c
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
42
43
44
45
46
47
#include <pylists4c.h>
int main()
{
LIST* pList = NULL;
pList = list("1, 2, 3");
listPrint(pList);
listClear(&pList);
printf("\n");
pList = list("\"abc\", \"def\", \"ghi\"");
listPrint(pList);
listClear(&pList);
printf("\n");
pList = list("123, 456.789, -987, 'abc', \"def\", ['r', 2, 'd', 2]");
listPrint(pList);
printf("\n");
listDebug(pList, "pList");
listClear(&pList);
printf("\n");
pList = list(" 1, 2 , garbage, .3, 4.5.6, 'a\"b', \"c'd\", 'e\\f', 'end'");
listPrint(pList);
printf("\n");
listDebug(pList, "pList");
listClear(&pList);
printf("\n");
pList = list("'nested', ['lists', ['are', ['possible']]]");
listPrint(pList);
printf("\n");
listDebug(pList, "pList");
listClear(&pList);
printf("\n");
pList = list("'empty lists too', []");
listPrint(pList);
printf("\n");
listDebug(pList, "pList");
listClear(&pList);
printf("\nAllocated memory: %lu\n", listGetAllocatedMemory());
return 0;
}