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

1.5 KiB

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 code:

---
id: fn1
...

Empty YAML and code:

---
...

Misses arg:

---
id: fn1
...
#a + #b

Misses id:

---
identifier: fn1
...
1 + 2 + 3

Wrong id (doesn't starts with %a):

---
id: 1
...
1 + 2 + 3

Wrong id (doesn't follows with %w):

---
id: f-1
...
1 + 2 + 3

Wrong id (more than 1 word):

---
id: f n1
...
1 + 2 + 3

Uknown cmd:

---
id: fn1
cmd: pyton -E -X utf8
args:
  n: 2
...
#n + #n

Unknown key:

---
id: fn1
language: fennel
args:
  a: 1
  b: 2
...
(* #a #b)

Invalid value:

---
id: fn1
shift: "true"
...
"The literate block is shifted by its eval result."

Invalid code:

---
id: fn1
...
false + false

Infinite loop:

---
id: fn1
args:
    x: 1
...
#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