forked from strongcourage/fuzzing-corpus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7ca47e4
commit d5aaf2c
Showing
1,041 changed files
with
12,539 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,25 @@ | ||
#unittest { | ||
name: "Test class instantiation."; | ||
error: NONE; | ||
result: 3; | ||
}; | ||
|
||
class foo { | ||
var a = 1; | ||
var b = 2; | ||
|
||
func f1() { | ||
return self.a; | ||
} | ||
|
||
func f2() { | ||
return b; | ||
} | ||
} | ||
|
||
func main() { | ||
var f = foo(); | ||
var a = f.f1(); | ||
var b = f.f2(); | ||
return a b; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,19 @@ | ||
#unittest { | ||
name: "Test combined init/call init."; | ||
error: NONE; | ||
result: 150; | ||
}; | ||
|
||
// no init | ||
class c1 { | ||
var p1; | ||
func f1() { | ||
p1 = 150; | ||
return p1; | ||
} | ||
} | ||
|
||
func main() { | ||
var x1 = c1().f1(); | ||
return x1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,19 @@ | ||
#unittest { | ||
name: "Test self set/get init."; | ||
error: NONE; | ||
result: 150; | ||
}; | ||
|
||
// no init | ||
class c1 { | ||
var p1; | ||
func f1() { | ||
self.p1 = 150; | ||
return self.p1; | ||
} | ||
} | ||
|
||
func main() { | ||
var x1 = c1().f1(); | ||
return x1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,23 @@ | ||
#unittest { | ||
name: "Test class instantiation."; | ||
error: NONE; | ||
result: 3; | ||
}; | ||
|
||
class foo { | ||
var a = 1; | ||
var b = 2; | ||
|
||
func f1() { | ||
return self.a; | ||
} | ||
|
||
func f2() { | ||
return b; | ||
} | ||
} | ||
|
||
func main() { | ||
var f = foo(); | ||
return f.f1() f.f2(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,23 @@ | ||
#unittest { | ||
name: "Test class instantiation."; | ||
error: NONE; | ||
result: 3; | ||
}; | ||
|
||
class foo { | ||
var a = 1; | ||
var b = 2; | ||
|
||
func f1() { | ||
return a; | ||
} | ||
|
||
func f2() { | ||
return b; | ||
} | ||
} | ||
|
||
func main() { | ||
var f = foo(); | ||
return f.f1() f.f2(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,23 @@ | ||
#unittest { | ||
name: "Test class instantiation."; | ||
error: NONE; | ||
result: 3; | ||
}; | ||
|
||
class foo { | ||
var a = 1; | ||
var b = 2; | ||
|
||
func f1() { | ||
return self.a; | ||
} | ||
|
||
func f2() { | ||
return self.b; | ||
} | ||
} | ||
|
||
func main() { | ||
var f = foo(); | ||
return f.f1() f.f2(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,25 @@ | ||
#unittest { | ||
name: "Test class instantiation."; | ||
error: NONE; | ||
result: 30; | ||
}; | ||
|
||
class foo { | ||
var a = 1; | ||
var b = 2; | ||
|
||
func f1() { | ||
return a; | ||
} | ||
|
||
func f2() { | ||
return b; | ||
} | ||
} | ||
|
||
func main() { | ||
var f = foo(); | ||
f.a = 10; | ||
f.b = 20; | ||
return f.f1() f.f2(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,27 @@ | ||
#unittest { | ||
name: "Test class instantiation."; | ||
error: NONE; | ||
result: 783; | ||
}; | ||
|
||
class foo { | ||
var a = 1; | ||
var b = 2; | ||
|
||
func f1() { | ||
return self.a self.b; | ||
} | ||
|
||
func f2() { | ||
self.a = 50; | ||
self.b = 730; | ||
} | ||
} | ||
|
||
func main() { | ||
var f = foo(); | ||
var n1 = f.f1(); | ||
f.f2(); | ||
var n2 = f.f1(); | ||
return n1 n2; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,27 @@ | ||
#unittest { | ||
name: "Test class instantiation."; | ||
error: NONE; | ||
result: 783; | ||
}; | ||
|
||
class foo { | ||
var a = 1; | ||
var b = 2; | ||
|
||
func f1() { | ||
return a b; | ||
} | ||
|
||
func f2() { | ||
a = 50; | ||
b = 730; | ||
} | ||
} | ||
|
||
func main() { | ||
var f = foo(); | ||
var n1 = f.f1(); | ||
f.f2(); | ||
var n2 = f.f1(); | ||
return n1 n2; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,21 @@ | ||
#unittest { | ||
name: "Test class ivar (a) and lookup (b)."; | ||
error: NONE; | ||
result: 3; | ||
}; | ||
|
||
class foo { | ||
var a = 1; | ||
func b() {return 2;} | ||
|
||
func f1() { | ||
var n1 = a; | ||
var n2 = b; | ||
return n1 n2(); | ||
} | ||
} | ||
|
||
func main() { | ||
var f = foo(); | ||
return f.f1(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,14 @@ | ||
#unittest { | ||
name: "Test _func keyword."; | ||
error: NONE; | ||
result: 6765; | ||
}; | ||
|
||
func fibonacci (n) { | ||
if (n<2) return n; | ||
return _func(n-2) _func(n-1); | ||
} | ||
|
||
func main() { | ||
return fibonacci(20); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,14 @@ | ||
#unittest { | ||
name: "ADD operation and function calls;"; | ||
error: NONE; | ||
result: "classname: (bar)"; | ||
}; | ||
|
||
class foo {} | ||
class bar:foo {} | ||
|
||
func main() { | ||
var v = bar(); | ||
var log = "classname: (" v.Class().name() ")"; | ||
return log; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,40 @@ | ||
#unittest { | ||
name: "Anonimous class test"; | ||
result: 666 | ||
}; | ||
|
||
var Window1; | ||
|
||
class _Window1 { | ||
var button; | ||
|
||
class _Button1 { | ||
func test() { | ||
return 777; | ||
} | ||
} | ||
|
||
func setup() { | ||
button = _Button1(); | ||
button.bind("action", {var a = Window1.action(); return a;}) | ||
} | ||
|
||
func action() { | ||
return 666; | ||
} | ||
} | ||
|
||
func main() { | ||
Window1 = _Window1(); | ||
Window1.setup(); | ||
|
||
var test = Window1.action(); | ||
var button = Window1.button; | ||
button.test(); | ||
var temp = button.action(); | ||
|
||
// force GC to run | ||
var l = [1,2,3]; | ||
|
||
return temp; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,17 @@ | ||
#unittest { | ||
name: "_args used in expression."; | ||
error: NONE; | ||
result: 640; | ||
}; | ||
|
||
func sum() { | ||
var tot = 0; | ||
_args.loop(func (value) {tot =value}); | ||
return tot; | ||
} | ||
|
||
func main() { | ||
var a = 10; | ||
var b = 20; | ||
return sum(a, b, a*(a b 9) (b-a), a, a*b) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,13 @@ | ||
#unittest { | ||
name: "Test arguments keyword."; | ||
error: NONE; | ||
result: 100; | ||
}; | ||
|
||
func sum (a,b,c) { | ||
return _args[-1]; | ||
} | ||
|
||
func main() { | ||
return sum(10,20,30,40,50,60,70,80,90,100); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,13 @@ | ||
#unittest { | ||
name: "Test arguments keyword."; | ||
error: NONE; | ||
result: 10; | ||
}; | ||
|
||
func sum (a,b,c) { | ||
return _args.count; | ||
} | ||
|
||
func main() { | ||
return sum(10,20,30,40,50,60,70,80,90,100); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,17 @@ | ||
#unittest { | ||
name: "Test arguments keyword."; | ||
error: NONE; | ||
result: 550; | ||
}; | ||
|
||
func sum () { | ||
var tot = 0; | ||
for (var i in 0..<_args.count) { | ||
tot = _args[i]; | ||
} | ||
return tot; | ||
} | ||
|
||
func main() { | ||
return sum(10,20,30,40,50,60,70,80,90,100); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,12 @@ | ||
#unittest { | ||
name: "Arithmetic expression ( ,-) with multiple subnodes, testing operator execution order."; | ||
error: NONE; | ||
result: 5; | ||
}; | ||
|
||
func main() { | ||
var a = 5; | ||
var b = 2; | ||
var c = 2; | ||
return a - b c; | ||
} |
Oops, something went wrong.