@@ -36,25 +36,29 @@ struct SweepWireTests {
3636
3737 /// `JSON.parse` acceptance, and `JSON.stringify` of what it parsed, keys
3838 /// in JS property order, for each input.
39- @ Test func json ( ) throws {
40- for c in try Vectors . cases ( " sweep-json " ) {
41- let input = c [ " input " ] ! . stringValue !
42- let ok = c [ " ok " ] ! . boolValue !
43- let value : JSONValue
44- do {
45- value = try JSONParser . parse ( input )
46- } catch {
47- #expect ( ! ok , " rejected \( String ( reflecting : input ) ) : \( error ) " )
48- continue
39+ /// On an 8 MB stack, as `deepRowValue`: a vector nests 1,000 deep.
40+ @ Test func json ( ) async throws {
41+ let cases = try Vectors . cases ( " sweep-json " )
42+ try await onLargeStack {
43+ for c in cases {
44+ let input = c [ " input " ] ! . stringValue !
45+ let ok = c [ " ok " ] ! . boolValue !
46+ let value : JSONValue
47+ do {
48+ value = try JSONParser . parse ( input )
49+ } catch {
50+ #expect ( ! ok , " rejected \( String ( reflecting : input ) ) : \( error ) " )
51+ continue
52+ }
53+ #expect ( ok , " accepted \( String ( reflecting : input ) ) " )
54+ guard ok else { continue }
55+ let expected = c [ " stringify " ] ! . stringValue !
56+ let actual = JSONSerializer . stringify ( value )
57+ #expect (
58+ Self . same ( actual , expected ) ,
59+ " \( String ( reflecting : input ) ) : Swift \( actual . debugDescription ) , JS \( expected . debugDescription ) "
60+ )
4961 }
50- #expect ( ok , " accepted \( String ( reflecting : input ) ) " )
51- guard ok else { continue }
52- let expected = c [ " stringify " ] ! . stringValue !
53- let actual = JSONSerializer . stringify ( value )
54- #expect (
55- Self . same ( actual , expected ) ,
56- " \( String ( reflecting : input ) ) : Swift \( actual . debugDescription ) , JS \( expected . debugDescription ) "
57- )
5862 }
5963 }
6064
0 commit comments