computable-pandoc/tests/fail.lit.errors.md

140 lines
1.5 KiB
Markdown
Raw Normal View History

2023-03-16 15:58:56 -06:00
# Invalid Blocks
All errors should be collected, printed and exit with 1.
Malformed YAML:
---
id: fn1
fail
...
1 + 2 + 3
Empty YAML:
---
...
1 + 2 + 3
Empty YAML and code:
---
...
2023-03-16 15:58:56 -06:00
Misses id:
---
identifier: fn1
...
1 + 2 + 3
Wrong id (doesn't starts with `%a`):
---
id: 1
...
1 + 2 + 3
2023-03-20 19:28:32 -06:00
Wrong id (doesn't follows with `[_%w]`):
2023-03-16 15:58:56 -06:00
---
id: f-1
...
1 + 2 + 3
Wrong id (more than 1 word):
---
id: f n1
...
1 + 2 + 3
2023-03-20 19:28:32 -06:00
Invalid value:
2023-03-16 15:58:56 -06:00
---
id: fn1
2023-03-20 19:28:32 -06:00
shift: "true"
2023-03-16 15:58:56 -06:00
...
2023-03-20 19:28:32 -06:00
Invalid shift value
2023-03-16 15:58:56 -06:00
2023-03-20 19:28:32 -06:00
Invalid path:
---
id: fn1
dump: invalid/path.txt
...
Invalid dump value
Extra key:
2023-03-16 15:58:56 -06:00
---
id: fn1
language: fennel
args:
a: 1
b: 2
...
(* #a #b)
2023-03-20 19:28:32 -06:00
Empty code:
2023-03-16 15:58:56 -06:00
---
id: fn1
...
2023-03-20 19:28:32 -06:00
Misses arg:
---
id: fn1
...
#a + #b
2023-03-16 15:58:56 -06:00
Invalid code:
---
id: fn1
...
false + false
2023-03-20 19:28:32 -06:00
Uknown cmd:
---
id: fn1
cmd: piton -E -X utf8
args:
n: 2
...
#n + #n
2023-03-16 15:58:56 -06:00
Infinite loop:
---
id: fn1
args:
2023-03-20 19:28:32 -06:00
x: 1
2023-03-16 15:58:56 -06:00
...
#fn1(2) * #x
# Blocks for Invalid Inserts:
---
id: fn1
typed: true
args:
a: 1
b: 2
...
#a * #b
# Invalid Inserts
- `fn1(` never end
- `fn1(invalid arg)`
- `fn1()` misses args
- `fn1(1)` less args
- `fn1(1, 2, 3)` extra args
- `fn1(x: 3, y: 4)` wrong kwargs
- `fn1(1, a: 2)` mixed arg and kwarg
- `fn1(a: 1.0, b: 2.0)` misses type
- `fn2()` not declared