mirror of
https://github.com/TangentFoxy/etlua.git
synced 2025-07-28 02:52:17 +00:00
add compile_to_lua helper function
This commit is contained in:
@@ -112,6 +112,18 @@ This is my message to <%= [=[oh yeah %>"]=] %>]]
|
||||
out = fn {}, buff
|
||||
assert.same "firsthelloyeah", out
|
||||
|
||||
it "should compile readme example", ->
|
||||
parser = Parser!
|
||||
|
||||
first_fn = parser\load parser\compile_to_lua "Hello "
|
||||
second_fn = parser\load parser\compile_to_lua "World"
|
||||
|
||||
buffer = {}
|
||||
parser\run first_fn, nil, buffer
|
||||
parser\run second_fn, nil, buffer
|
||||
|
||||
assert.same "Hello World", table.concat buffer
|
||||
|
||||
describe "Parser.in_string", ->
|
||||
cases = {
|
||||
{ "hello world", false }
|
||||
|
Reference in New Issue
Block a user