Commit Graph

12 Commits (master)

Author SHA1 Message Date
Nicolas Hake b87f8e3f47 C4Script: Add ParseInt function
ParseInt() will take a string parameter and try to convert it into an
integer. If the conversion fails, it returns nil.
2017-04-11 14:21:25 +02:00
Nicolas Hake 46f342dd0c Tests: Split test helper functions into Expr/Code/Script evaluators
RunExpr will evaluate and return the value of a single expression.
RunCode will evaluate a full function body.
RunScript will compile a complete standalone script and return the
return value of its Main() function.
2016-10-19 13:45:11 +02:00
Nicolas Hake f2bf34ff3e Add missing semicolons to CreateEffect tests 2016-05-09 12:33:56 +02:00
Günther Brammer b00b8554ab Merge branch script 2016-04-28 03:25:44 +02:00
Günther Brammer d8e8d25ab4 Aul tests: CreateEffect 2016-04-28 02:59:11 +02:00
Nicolas Hake d21f75829d Aul tests: stop GMock from complaining about uninteresting log calls 2016-04-24 14:01:23 +02:00
Günther Brammer 1e8dafd75d Fix Translate AulTest when compiling without string deduplication 2016-02-02 02:57:45 +01:00
Günther Brammer 08f1037866 Add some more C4Script tests 2016-01-25 00:43:24 +01:00
Nicolas Hake 4fddda20f9 C4Script: Accept array parameter for Min, Max
Min/Max with array parameter will return the smallest/largest value of
all elements of the array. If any array element is not an integer, nor
convertible to integer, the function will fail.
2016-01-23 13:49:10 +01:00
Nicolas Hake b7cffa5e82 Aul tests: Assert that Translate() warns when a translation is missing
I'm not a huge fan of testing for warnings by hijacking the logging
routines, but right now there's no way to exfiltrate warnings from Aul
any other way, so it'll have to do.

Overriding the logging functions from C4SimpleLog.cpp has the nice
additional advantage that expected runtime errors no longer get written
to stdout - this is okay because we're already checking that an
exception is thrown.
2016-01-23 13:49:09 +01:00
Nicolas Hake 53fe0fa1cc Aul Tests: Move Translate() test stub to predefined functions test
As small as the Translate() test is, it is exercising a predefined
function and not just the Aul engine itself.
2016-01-23 13:49:08 +01:00
Nicolas Hake 24839204ce Tests: Add tests for Min, Max 2016-01-23 13:49:07 +01:00