packages feed

kdl-hs-1.2.1: test/KDL/__snapshots__/DecoderSpec.snap.md

# test/KDL/DecoderSpec.hs

## decodeWith ≫ fails with helpful error if parsing fails

```
1:8:
  |
1 | foo 123=123
  |        ^
unexpected '='
expecting children block, decimal point, end of node, exponent, or node prop or arg
```

## decodeWith ≫ fails with user-defined error

```
<input>:1:5:
    • Got negative number: -1.0
  │
1 │ foo -1
  │     ^^
```

## decodeWith ≫ shows context in deeply nested error

```
<input>:1:39:
    • Expected string, got: 1
  │
1 │ foo; foo { bar { baz; baz; baz; baz a=1; }; }
  │                                       ^
```

## decodeFileWith ≫ fails with helpful error if parsing fails

```
test_config.kdl:1:8:
  |
1 | foo 123=123
  |        ^
unexpected '='
expecting children block, decimal point, end of node, exponent, or node prop or arg
```

## decodeFileWith ≫ fails with user-defined error

```
test_config.kdl:1:5:
    • Got negative number: -1.0
  │
1 │ foo -1
  │     ^^
```

## decodeFileWith ≫ shows context in deeply nested error

```
test_config.kdl:1:39:
    • Expected string, got: 1
  │
1 │ foo; foo { bar { baz; baz; baz; baz a=1; }; }
  │                                       ^
```

## decodeDocWith ≫ fails with user-defined error

```
At: foo #0 > arg #0
└─ Got negative number: -1.0
```

## decodeDocWith ≫ shows context in deeply nested error

```
At: foo #1 > bar #0 > baz #3 > prop a
└─ Expected string, got: 1
```

## Error messages ≫ only shows first line when context spans multiple lines

```
<input>:1:1:
    • Expected node: bar
  │
1 │ foo \
  │ ^^^^^
```