File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
IntegrationTests/TestSuites/Sources/PrimaryTests Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -343,14 +343,18 @@ try test("Closure Identifiers") {
343
343
}
344
344
345
345
func checkArray< T> ( _ array: [ T ] ) throws where T: TypedArrayElement {
346
- try expectEqual ( JSTypedArray ( array) . toString!( ) , . string( jsStringify ( array) ) )
346
+ try expectEqual ( toString ( JSTypedArray ( array) . jsValue ( ) . object!) , jsStringify ( array) )
347
+ }
348
+
349
+ func toString< T: JSObject > ( _ object: T ) -> String {
350
+ return object. toString!( ) . string!
347
351
}
348
352
349
353
func jsStringify( _ array: [ Any ] ) -> String {
350
354
array. map ( { String ( describing: $0) } ) . joined ( separator: " , " )
351
355
}
352
356
353
- test ( " TypedArray " ) {
357
+ try test ( " TypedArray " ) {
354
358
let numbers = [ UInt8] ( 0 ... 255 )
355
359
let typedArray = JSTypedArray ( numbers)
356
360
try expectEqual ( typedArray [ 12 ] , 12 )
@@ -380,13 +384,13 @@ test("TypedArray") {
380
384
}
381
385
}
382
386
383
- test ( " TypedArray_Mutation " ) {
387
+ try test ( " TypedArray_Mutation " ) {
384
388
let array = JSTypedArray < Int > ( length: 100 )
385
389
for i in 0 ..< 100 {
386
390
array [ i] = i
387
391
}
388
392
for i in 0 ..< 100 {
389
393
try expectEqual ( i, array [ i] )
390
394
}
391
- try expectEqual ( array. toString! ( ) , . string ( jsStringify ( Array ( 0 ..< 100 ) ) ) )
395
+ try expectEqual ( toString ( array. jsValue ( ) . object! ) , jsStringify ( Array ( 0 ..< 100 ) ) )
392
396
}
You can’t perform that action at this time.
0 commit comments