Tests ready

This commit is contained in:
perro tuerto 2023-03-14 14:46:51 -07:00
parent 328cca695b
commit e7db4df984
10 changed files with 82 additions and 74 deletions

View File

@ -13,11 +13,11 @@
# Invalid Calls # Invalid Calls
* fn1(1, $stdout: "true") has invalid rkwarg value - fn1(1, $stdout: "true") has invalid rkwarg value
* fn1(1, $act: "return") has invalid rkwarg - fn1(1, $act: "return") has invalid rkwarg
* fn1(1, $eval: "/path/does/not/exists") has invalid path - fn1(1, $eval: "/path/does/not/exists") has invalid path
* fn1(1, $code: "/path/does/not/exists") has invalid path - fn1(1, $code: "/path/does/not/exists") has invalid path
* fn1(1, $lua: "/path/does/not/exists") has invalid path - fn1(1, $lua: "/path/does/not/exists") has invalid path
* fn1(fn4()); `fn4()` is not declared - fn1(fn4()); `fn4()` is not declared
Invalid calls and declarations generate and collects errors. Invalid calls and declarations generate and collects errors.

View File

@ -25,14 +25,14 @@
# Invalid Calls # Invalid Calls
* fn1(1) adds arg - fn1(1) adds arg
* fn1( never end - fn1( never end
* fn1(invalid arg) - fn1(invalid arg)
* fn2() misses arg - fn2() misses arg
* fn2(a: 3) wrong kwarg - fn2(a: 3) wrong kwarg
* fn3(1 2) misses separator - fn3(1 2) misses separator
* fn3(1, 2, 3) wrong args number - fn3(1, 2, 3) wrong args number
* fn3(1, b: 2) mixed arg and kwarg - fn3(1, b: 2) mixed arg and kwarg
* fn4() fn5() not declared - fn4() fn5() not declared
Invalid calls and declarations generate and collects errors. Invalid calls and declarations generate and collects errors.

View File

@ -28,19 +28,23 @@
Valid calls: Valid calls:
* fn1($stdout: true) gets stdout instead of evaluation result. - fn1($stdout: true) gets stdout instead of evaluation result.
* fn1($action: "wipe") wipes calls and declarations of this function from source document after all calls. - fn1($action: "wipe") wipes calls and declarations of this function from
* fn2($action: "return") returns result after call. source document after all calls.
* fn2($action: "hide") hides call from source document after call. - fn2($action: "return") returns result after call.
* fn2($action: "quote") quotes it without call. - fn2($action: "hide") hides call from source document after call.
* fn2($eval: "fn2.txt", $code: "fn2.fnl", $lua: "fn2.lua") writes evaluation results, Fennel code and Lua code. - fn2($action: "quote") quotes it without call.
* fn3(4, $action: "return") has arg and rkwarg. - fn2($eval: "fn2.txt", $code: "fn2.fnl", $lua: "fn2.lua") writes
* fn3($action: "return", 5) has rkwarg and arg. evaluation results, Fennel code and Lua code.
* fn3($eval: "fn3-4.txt", $code: "fn3-4.fnl", $lua: "fn3-4.lua") writes in same files than below. - fn3(4, $action: "return") has arg and rkwarg.
* fn4(a: 1, b: 2, $action: "return") has kwargs and rkwarg. - fn3($action: "return", 5) has rkwarg and arg.
* fn4($action: "return", a: 1, b: 2) has rkwarg and kwargs. - fn3($eval: "fn3-4.txt", $code: "fn3-4.fnl", $lua: "fn3-4.lua") writes in
* fn4(a: 1, $action: "return", b: 2) has kwarg, rkwarg and kwarg. same files than below.
* fn4($eval: "fn3-4.txt", $code: "fn3-4.fnl", $lua: "fn3-4.lua") writes in same files than above. - fn4(a: 1, b: 2, $action: "return") has kwargs and rkwarg.
* fn5(10) calls another function inside. - fn4($action: "return", a: 1, b: 2) has rkwarg and kwargs.
* fn6(9, 8) calls another quoted function inside. - fn4(a: 1, $action: "return", b: 2) has kwarg, rkwarg and kwarg.
* fn7(fn7(1)) calls several functions. - fn4($eval: "fn3-4.txt", $code: "fn3-4.fnl", $lua: "fn3-4.lua") writes in
same files than above.
- fn5(10) calls another function inside.
- fn6(9, 8) calls another quoted function inside.
- fn7(fn7(1)) calls several functions.

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
# Not declarations # Not declarations
-- doesn't starts with `%a`: \fn1() -- skipped: \fn1()
1 + 2 1 + 2
-- doesn't starts with `%a` because of the space: fn 2() -- doesn't starts with `%a` because of the space: fn 2()
@ -20,10 +20,10 @@
# Not calls # Not calls
* \fn1() doesn't starts with `%a` - \fn1() skipped
* fn 2() doesn't starts with `%a` because of the space - fn 2() doesn't starts with `%a` because of the space
* fn-3() doesn't continue with `%w` - fn-3() doesn't continue with `%w`
* fn4 () space before `(` - fn4 () space before `(`
* fn5) misses `(` - fn5) misses `(`
* fn6 misses `()` - fn6 misses `()`
* `fn1()` as inline code - `fn1()` as inline code

View File

@ -0,0 +1 @@
{"pandoc-api-version":[1,23],"meta":{},"blocks":[{"t":"Header","c":[1,["not-declarations",[],[]],[{"t":"Str","c":"Not"},{"t":"Space"},{"t":"Str","c":"declarations"}]]},{"t":"CodeBlock","c":[["",[],[]],"-- skipped: \\fn1()\n1 + 2\n\n-- doesn't starts with `%a` because of the space: fn 2()\n1 + 2\n\n-- doesn't continue with `%w`: fn-3()\n1 + 2\n\n-- space before `(`: fn4 ()\n1 + 2\n\n-- misses `(`: fn5) \n1 + 2\n\n-- misses `()`: fn6 \n1 + 2"]},{"t":"Header","c":[1,["not-calls",[],[]],[{"t":"Str","c":"Not"},{"t":"Space"},{"t":"Str","c":"calls"}]]},{"t":"BulletList","c":[[{"t":"Plain","c":[{"t":"RawInline","c":["tex","\\fn1"]},{"t":"Str","c":"()"},{"t":"Space"},{"t":"Str","c":"skipped"}]}],[{"t":"Plain","c":[{"t":"Str","c":"fn"},{"t":"Space"},{"t":"Str","c":"2()"},{"t":"Space"},{"t":"Str","c":"doesnt"},{"t":"Space"},{"t":"Str","c":"starts"},{"t":"Space"},{"t":"Str","c":"with"},{"t":"Space"},{"t":"Code","c":[["",[],[]],"%a"]},{"t":"Space"},{"t":"Str","c":"because"},{"t":"Space"},{"t":"Str","c":"of"},{"t":"Space"},{"t":"Str","c":"the"},{"t":"Space"},{"t":"Str","c":"space"}]}],[{"t":"Plain","c":[{"t":"Str","c":"fn-3()"},{"t":"Space"},{"t":"Str","c":"doesnt"},{"t":"Space"},{"t":"Str","c":"continue"},{"t":"Space"},{"t":"Str","c":"with"},{"t":"Space"},{"t":"Code","c":[["",[],[]],"%w"]}]}],[{"t":"Plain","c":[{"t":"Str","c":"fn4"},{"t":"Space"},{"t":"Str","c":"()"},{"t":"Space"},{"t":"Str","c":"space"},{"t":"Space"},{"t":"Str","c":"before"},{"t":"Space"},{"t":"Code","c":[["",[],[]],"("]}]}],[{"t":"Plain","c":[{"t":"Str","c":"fn5)"},{"t":"Space"},{"t":"Str","c":"misses"},{"t":"Space"},{"t":"Code","c":[["",[],[]],"("]}]}],[{"t":"Plain","c":[{"t":"Str","c":"fn6"},{"t":"Space"},{"t":"Str","c":"misses"},{"t":"Space"},{"t":"Code","c":[["",[],[]],"()"]}]}],[{"t":"Plain","c":[{"t":"Code","c":[["",[],[]],"fn1()"]},{"t":"Space"},{"t":"Str","c":"as"},{"t":"Space"},{"t":"Str","c":"inline"},{"t":"Space"},{"t":"Str","c":"code"}]}]]}]}

View File

@ -1,13 +1,13 @@
# Calls Before Declarations # Calls Before Declarations
* A common call: fn1(). All calls results should be print on `--verbose`. - A common call: fn1(). All calls results should be print on `--verbose`.
* fn1() another common call. - fn1() another common call.
* fn1() - fn1()
* Two calls: fn1() and fn1(). - Two calls: fn1() and fn1().
* Two consecutive calls: fn1() fn1(). - Two consecutive calls: fn1() fn1().
* A call with one arg: fn2(1). - A call with one arg: fn2(1).
* A call with two args: fn3(2, 3). - A call with two args: fn3(2, 3).
* A call with args as kwargs: fn2(n: 2) and fn3(b: 4, a: 5). - A call with args as kwargs: fn2(n: 2) and fn3(b: 4, a: 5).
# Declarations # Declarations
@ -18,7 +18,7 @@ A declaration:
All declarations should be print on `--verbose`. All declarations should be print on `--verbose`.
A declaration with one arg: A declaration with one arg:
-- Also valid, Lua is the default: fn2(n) -- Also valid, Lua is the default: fn2(n)
#n .. " " .. #n #n .. " " .. #n
@ -40,30 +40,30 @@ A declaration with arg and scaped:
# Calls and Data Types # Calls and Data Types
* fn2(3); integer - fn2(3); integer
* fn2(1_000); integer with separator - fn2(1_000); integer with separator
* fn4(1.0); float - fn4(1.0); float
* fn5("str"); string - fn5("str"); string
* fn5(true) - fn5(true)
* fn5(false) - fn5(false)
* fn2([]); empty array / list / sequential table - fn2([]); empty array / list / sequential table
* fn2([0, 1]); array / list / sequential table - fn2([0, 1]); array / list / sequential table
* fn2({}); empty dict / table - fn2({}); empty dict / table
* fn2({"k1": 1, "k2": 2}); dict / table - fn2({"k1": 1, "k2": 2}); dict / table
# Messy Calls # Messy Calls
* fn1( ) - fn1( )
* fn2( 4) - fn2( 4)
* fn2(5 ) - fn2(5 )
* fn2( 6 ) - fn2( 6 )
* fn2( n: 7) - fn2( n: 7)
* fn2(n: 8 ) - fn2(n: 8 )
* fn2( n: 9 ) - fn2( n: 9 )
* fn2(n:10) - fn2(n:10)
* fn3( a: 6, b: 7) - fn3( a: 6, b: 7)
* fn3( a: 8 , b: 9) - fn3( a: 8 , b: 9)
* fn3( a: 10 , b: 11) - fn3( a: 10 , b: 11)
* fn3( a: 12 , b: 13) - fn3( a: 12 , b: 13)
* fn3( a: 14 , b: 15 ) - fn3( a: 14 , b: 15 )
* fn3(a:16,b:17) - fn3(a:16,b:17)

File diff suppressed because one or more lines are too long

View File

@ -18,5 +18,5 @@
# Calls # Calls
* fn1() - fn1()
* fn3(1) - fn3(1)

View File

@ -0,0 +1 @@
{"pandoc-api-version":[1,23],"meta":{},"blocks":[{"t":"Header","c":[1,["declaration-override",[],[]],[{"t":"Str","c":"Declaration"},{"t":"Space"},{"t":"Str","c":"Override"}]]},{"t":"CodeBlock","c":[["",[],[]],"-- fn1()\n1 + 2 + 3\n\n-- fn1()\n4 + 5 + 6"]},{"t":"Header","c":[1,["unused-declaration",[],[]],[{"t":"Str","c":"Unused"},{"t":"Space"},{"t":"Str","c":"Declaration"}]]},{"t":"CodeBlock","c":[["",[],[]],"-- fn2(n)\n#n .. \" \" .. #n"]},{"t":"Header","c":[1,["declaration-with-unused-argument",[],[]],[{"t":"Str","c":"Declaration"},{"t":"Space"},{"t":"Str","c":"with"},{"t":"Space"},{"t":"Str","c":"Unused"},{"t":"Space"},{"t":"Str","c":"Argument"}]]},{"t":"CodeBlock","c":[["",[],[]],"-- fn3(a)\n7 + 8 + 9"]},{"t":"Header","c":[1,["calls",[],[]],[{"t":"Str","c":"Calls"}]]},{"t":"BulletList","c":[[{"t":"Plain","c":[{"t":"Str","c":"fn1()"}]}],[{"t":"Plain","c":[{"t":"Str","c":"fn3(1)"}]}]]}]}