mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 23:46:26 +02:00
add test for print/Script.print behavior
This commit is contained in:
parent
fe36e6a793
commit
8cea7f6a62
1 changed files with 34 additions and 0 deletions
34
scripts/developer/tests/printTest.js
Normal file
34
scripts/developer/tests/printTest.js
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
/* eslint-env jasmine */
|
||||||
|
|
||||||
|
// this test generates sample print, Script.print, etc. output
|
||||||
|
|
||||||
|
main();
|
||||||
|
|
||||||
|
function main() {
|
||||||
|
// to match with historical behavior, Script.print(message) output only triggers
|
||||||
|
// the printedMessage signal (and therefore doesn't show up in the application log)
|
||||||
|
Script.print('[Script.print] hello world');
|
||||||
|
|
||||||
|
// the rest of these should show up in both the application log and signaled print handlers
|
||||||
|
print('[print]', 'hello', 'world');
|
||||||
|
|
||||||
|
// note: these trigger the equivalent of an emit
|
||||||
|
Script.printedMessage('[Script.printedMessage] hello world', '{filename}');
|
||||||
|
Script.errorMessage('[Script.errorMessage] hello world', '{filename}');
|
||||||
|
|
||||||
|
{
|
||||||
|
// FIXME: while not directly related to Script.print, these currently don't
|
||||||
|
// show up at all in the "HMD-friendly script log" or "Console..."
|
||||||
|
|
||||||
|
Script.infoMessage('[Script.infoMessage] hello world', '{filename}');
|
||||||
|
Script.warningMessage('[Script.warningMessage] hello world', '{filename}');
|
||||||
|
|
||||||
|
Vec3.print('[Vec3.print]', Vec3.HALF);
|
||||||
|
|
||||||
|
var q = Quat.fromPitchYawRollDegrees(45, 45, 45);
|
||||||
|
Quat.print('[Quat.print]', q);
|
||||||
|
|
||||||
|
var m = Mat4.createFromRotAndTrans(q, Vec3.HALF);
|
||||||
|
Mat4.print('[Mat4.print (row major)]', m);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue