Nasal Unit Testing Framework: Difference between revisions

Jump to navigation Jump to search
m
Use Nasal highlighter
m (Use Nasal highlighter)
Line 89: Line 89:


Wrapping APIs is simple to do in Nasal, too - without even requiring C/C++ changes, a standalone testbed could be scripted in Nasal like this:
Wrapping APIs is simple to do in Nasal, too - without even requiring C/C++ changes, a standalone testbed could be scripted in Nasal like this:
<syntaxhighlight lang="php">
<syntaxhighlight lang="nasal">


var tree = {};
var tree = {};
Line 145: Line 145:


We would need to use custom script-specific wrappers, instead of the main FG/Nasal APIs and modules - so that your Nasal code *never* uses the APIs directly, that way you can easily have different implementations - i.e.
We would need to use custom script-specific wrappers, instead of the main FG/Nasal APIs and modules - so that your Nasal code *never* uses the APIs directly, that way you can easily have different implementations - i.e.
<syntaxhighlight lang="php">
<syntaxhighlight lang="nasal">
var debug_profile = {};
var debug_profile = {};
var runtime_profile = {};
var runtime_profile = {};

Navigation menu