-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathexpected.txt
438 lines (431 loc) · 4.45 KB
/
expected.txt
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
testDefer start
hello defer
I am fmt.Print
bytes written=15
I am fmt.Println
fmt.Print:foobar123
fmt.Println foo bar 456
hello defer
testIfcMethod2
expect MyFile:Write
MyFile:Write
MyFile:Close
expect hello ifc method 2
hello ifc method 2
hello ifc method 3
hello io.Writer
0xff == 255
expected error.
OK
OK
OK
OK
object addresses match
testDereference Start
testDereference 1
testDereference 2
type of v = *uint8
testDereference 3
is int
is not string
x=1
blank ok
0 & 0 = 0
1 & 0 = 0
240 & 15 = 0
1 & 1 = 1
c = 0
255 & 12 = 12
0 | 0 = 0
1 | 0 = 1
240 | 15 = 255
1 | 1 = 1
c = 1023
test syscall.Write
testTypeSwitchShortVar ok
f001=1
f001=1
test syscall.Write
sum=5
testMapForrange start
testMapForrange 243
testMapForrange 245
testMapForrange 252
testMapForrange end
key1=>"value1"
noexist=>""
key1=>"value1"
noexist=>""
len=>"0"
len=>"1"
noexist=>""
key1=>"value1"
key2=>""
key2=>"value2"
len=>"2"
key1=>""
len=>"1"
--------
len=>"0"
i=>0
i=>2
mp.Len=0
mp.Len=2
mp.a=11
mp.bb=22
mp.ccc=333
mp.Len=2
mp.bb is nil
mp.Len=1
mp.Len=0
I am nil
10
20
hello
i=11
i=8
mt.field=216
sqi=hello
mt.field=216
abce=123,456,a.789
abc=aaa,bbb,ccc
abc=1000,2000,3000
abc=ABC
s=c
hello
%rax
number 1234
string I am string
types are string
types are int
types are *int
%!d(string=xyz)
1234abcdefg
string %!d(string=I am string)
%!s(int=123)
ok
--------------------------------
github.com/DQNEO/babygo/lib/strings
unsafe
reflect
github.com/DQNEO/babygo/lib/fmt
github.com/DQNEO/babygo/lib/mylib2
github.com/DQNEO/babygo/lib/strconv
syscall
github.com/DQNEO/babygo/lib/mylib
github.com/DQNEO/babygo/lib/path
os
--------------------------------
github.com/DQNEO/babygo/lib/fmt
github.com/DQNEO/babygo/lib/mylib
github.com/DQNEO/babygo/lib/mylib2
github.com/DQNEO/babygo/lib/path
github.com/DQNEO/babygo/lib/strconv
github.com/DQNEO/babygo/lib/strings
os
reflect
syscall
unsafe
counter=4, totallen=37
env FOO=bar
int
*int
string
main.MyStruct
*main.MyStruct
aabbcc
3
foo
bar
1
ok
23434
1225
2341044
12341055
12345
2345
1234
23
b
/
.
/a/b
a/b
/a
a
/
.
x
# testExtLib() => 7
3
2
4
6
3
foo
bar
buz
2
4
6
0
2
4
2
1419
s1419
7
8
9
10
11
12
13
14
type is *int
7
type is string
abcde
type is MySruct
222
type is bool
ifc is nil
1829
1537
aaaa
type matched
2021012420210124ok
20210124end of testInterfaceAssertion
I am string
ok
1111
eface match
22222
3333
4444
eface not match
eface not match
eface is nil
geface is nil
eface is nil
3210
03122130
20210122
123
abc
3
456
789
1010
gBool is true
gString
22
65
123
10
infer string literal
8
10
20
1
3
20
14
14
myargs
10
20
0
20
30
40
345
678
123
456
123
0
0
123
456
0
0
0
0
1
12
1234567890
-1234567890
-7
OK isLetter A
vaargs1: pass nil slice
a bc def
777 nil vaargs2 ok
testOpenRead
Open ok
280
In a hole in the ground there lived a hobbit. Not a nasty, dirty, wet hole, filled with the ends of worms and an oozy smell, nor yet a dry, bare, sandy hole with nothing in it to sit down on or to eat: it was a hobbit-hole, and that means comfort.
― J.R.R. Tolkien, The Hobbit
testOpenWrite
Open ok
8
infer string literal
8
start
\ '
end
swithc string 1 ok
switch string default ok
switch uint8 ok
switch default ok
switch int ok
switch default ok
true && true ok
true && false ok
false && true ok
false && false ok
true || true ok
true || false ok
false || true ok
false || false ok
24
234
012exit3
789exit10
012exit3
789exit9
globalbool 1 ok
globalbool 2 ok
globalbool 3 ok
bool 1 ok
bool ! 1 ok
bool 2 ok
bool 3 ok
nil pointer 1 ok
nil pointer 2 ok
nil pointer 3 ok
nil pointer 4 ok
ifc is nil
ifc is nil
this is slice literal
202
1
2
3
abbccc
xyz
123
aabb|aabb|aabb|
0123456789
abcdefghijklmn
3
12345678910
abcdefghijklmnopqrstuvwxyz
27
100
cde
abc
abc
ab
bc
0a
1b
2c
going to loop 0 times
going to loop 2 times
in loop
in loop
going to loop 4 times
0000
helloforrange
0
0
2
2
2
0
0
OK
OK
-- testZeroValues()
1
0
2
int zero ok
1
-1
aaa,bbb,aaa,bbb,hello strings
hello globalstrings
11
22
123
456
777
123
456
777
12
11
B
123
string cmp 1 ok
string cmp 2 ok
string cmp 3 ok
string cmp 4 ok
string cmp not 1 ok
string cmp not 2 ok
foobar1234
0
0
12
24
4
4
6
ABC
0
0
1
12
123
12345
12345678
1234567890
54321
-1
-54321
-7654321
-1234567890
66777788
66777788
hello string literal
hello string
i am a local 1
i am a local 1
i m local2
globalstring changed
AAA
uint8 cmp == ok
uint8 cmp != ok
uint8 cmp > ok
uint8 cmp < ok
uint8 cmp >= ok
uint8 cmp <= ok
int cmp == ok
int cmp != ok
int cmp > ok
int cmp < ok
int cmp >= ok
int cmp <= ok
ok else if
ok else if else
ok true
ok false
ok true
ok false
ABA
ABA
42
exec ok