File: invalid-input.jl

package info (click to toggle)
julia 1.5.3%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 91,132 kB
  • sloc: lisp: 278,486; ansic: 60,186; cpp: 29,801; sh: 2,403; makefile: 1,998; pascal: 1,313; objc: 647; javascript: 516; asm: 226; python: 161; xml: 34
file content (33 lines) | stat: -rw-r--r-- 727 bytes parent folder | download
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
const FAILURES = [
    # Unexpected character in array
    "[1,2,3/4,5,6,7]",
    # Unexpected character in object
    "{\"1\":2, \"2\":3 _ \"4\":5}",
    # Invalid escaped character
    "[\"alpha\\α\"]",
    "[\"\\u05AG\"]",
    # Invalid 'simple' and 'unknown value'
    "[tXXe]",
    "[fail]",
    "∞",
    # Invalid number
    "[5,2,-]",
    "[5,2,+β]",
    # Incomplete escape
    "\"\\",
    # Control character
    "\"\0\"",
    # Issue #99
    "[\"🍕\"_\"🍕\"",
    # Issue #260
    "1997-03-03",
    "1997.1-",
]

@testset for fail in FAILURES
    # Test memory parser
    @test_throws ErrorException JSON.parse(fail)

    # Test streaming parser
    @test_throws ErrorException JSON.parse(IOBuffer(fail))
end