1
1
import Test
2
2
@testable import V8
3
3
4
- test. case ( " evaluate " ) {
4
+ test ( " evaluate " ) {
5
5
let context = JSContext ( )
6
6
_ = try context. evaluate ( " 40 + 2 " )
7
7
}
8
8
9
- test. case ( " exception " ) {
10
- fail ( " FIXME: v9.3 crash " )
9
+ test ( " exception " ) {
10
+ fail ( " FIXME: v9.3-v12 crash " )
11
11
// let context = JSContext()
12
12
// expect(throws: JSError("ReferenceError: x is not defined")) {
13
13
// try context.evaluate("x()")
@@ -17,7 +17,7 @@ test.case("exception") {
17
17
// }
18
18
}
19
19
20
- test. case ( " function " ) {
20
+ test ( " function " ) {
21
21
let context = JSContext ( )
22
22
try context. createFunction ( name: " test " ) { ( _) -> Value in
23
23
return . string( " success " )
@@ -26,7 +26,7 @@ test.case("function") {
26
26
expect ( try result. toString ( ) == " success " )
27
27
}
28
28
29
- test. case ( " closure " ) {
29
+ test ( " closure " ) {
30
30
let context = JSContext ( )
31
31
32
32
try context. createFunction ( name: " testUndefined " ) {
@@ -60,7 +60,7 @@ test.case("closure") {
60
60
expect ( stringResult. isString)
61
61
}
62
62
63
- test. case ( " capture " ) {
63
+ test ( " capture " ) {
64
64
let context = JSContext ( )
65
65
66
66
var captured = false
@@ -73,7 +73,7 @@ test.case("capture") {
73
73
expect ( " \( result) " == " captured " )
74
74
}
75
75
76
- test. case ( " arguments " ) {
76
+ test ( " arguments " ) {
77
77
let context = JSContext ( )
78
78
try context. createFunction ( name: " test " ) { ( arguments) -> Void in
79
79
expect ( arguments. count == 2 )
@@ -83,7 +83,7 @@ test.case("arguments") {
83
83
try context. evaluate ( " test('one', 42) " )
84
84
}
85
85
86
- test. case ( " persistent context " ) {
86
+ test ( " persistent context " ) {
87
87
let context = JSContext ( )
88
88
try context. evaluate ( " result = 'success' " )
89
89
expect ( try context. evaluate ( " result " ) . toString ( ) == " success " )
@@ -95,8 +95,8 @@ test.case("persistent context") {
95
95
expect ( try context. evaluate ( " result " ) . toString ( ) == " success " )
96
96
}
97
97
98
- test. case ( " sandbox " ) {
99
- fail ( " FIXME: v9.3 crash " )
98
+ test ( " sandbox " ) {
99
+ fail ( " FIXME: v9.3-v12 crash " )
100
100
// try {
101
101
// let context = JSContext()
102
102
// try context.evaluate("test = 'hello'")
@@ -110,4 +110,4 @@ test.case("sandbox") {
110
110
// }
111
111
}
112
112
113
- test . run ( )
113
+ await run ( )
0 commit comments