Skip to content

fir.generic.emit.tests

An emitter that works with a GenericAST and turns it into runnable tests.

API

This is the API provided to work with the test emitter.

Element Summary
Functions
emit Emits Lua tests from a GenericAST using test and tagged-test nodes.
emitFunctionCall Emits a function call across languages
emitIfStatement Emits an if statement across languages
emitInlineFunctionDefinition Emits an inline function declaration across languages
emitInternal Emits tests, as an internal function to be used in several parts.
emitLocalDeclaration Emits a local declaration across languages
emitPairsForStatement Emits a for statement across languages
emitParentheses Emits an expression in parentheses across langauges
emitString Emits a string across languages
emitTableIndex Emits a table index across languages
emitTableLiteral Emits a table literal across languages
emitTestHeader Emits test headers.
emitTestWrapper Wraps a test line in counters and error protectors

emit 

:: ast:GenericAST, options:table -> code:string

Emits Lua tests from a GenericAST using test and tagged-test nodes.

  • Emits Lua tests from a GenericAST using test and tagged-test nodes.

emitFunctionCall 

:: fn:string, args:[string], options:table

Aliases: efn

Emits a function call across languages

emitIfStatement 

:: condition:string, block:[string], options:table

Aliases: eif

Emits an if statement across languages

  • Emits an if statement across languages

emitInlineFunctionDefinition 

:: args:[string], body:string, options:table

Aliases: eidef

Emits an inline function declaration across languages

emitInternal 

:: description:[DescriptionLine], options:table, append:function, prepend:function, placement:string -> nil

Emits tests, as an internal function to be used in several parts.

emitLocalDeclaration 

:: name:string, lhs:string, options:table

Aliases: elocal

Emits a local declaration across languages

emitPairsForStatement 

:: k:string, v:string, iterator:string, body:string, options:string

Aliases: eforp

Emits a for statement across languages

  • Emits a for statement across languages

emitParentheses 

:: content:string

Aliases: eparen

Emits an expression in parentheses across langauges

emitString 

:: content:string

Aliases: estring

Emits a string across languages

emitTableIndex 

:: table:string, index:string

Aliases: eindex

Emits a table index across languages

  • Emits a table index across languages

emitTableLiteral 

:: tbl:table, options:table

Aliases: etable

Emits a table literal across languages

emitTestHeader 

:: node:table, count:number, options:table, append:function, prepend:function, placement:string -> nil

Emits test headers.

emitTestWrapper 

:: name:string, count:number, body:string, options:table -> code:string

Aliases: ewrap

Wraps a test line in counters and error protectors

  • Wraps a test line in counters and error protectors