95 ) = ( (t ==
"eq") || (t ==
"equals") ) ?
98 ? (pf?true : str(
"PASSED: '", d,
"'"))
101 "FAILED: '", d,
"'; got '", cv,
102 "', expected to equal '", ev,
"'."
106 : ( (t ==
"ne") || (t ==
"not") ) ?
109 ? (pf?true : str(
"PASSED: '", d,
"'"))
112 "FAILED: '", d,
"'; got '", cv,
113 "', expected to not equal '", ev,
"'."
117 : ( (t ==
true) || (t ==
"true") || (t ==
"t") ) ?
validate(d, cv,
"equals",
true, p, pf)
118 : ( (t == false) || (t ==
"false") || (t ==
"f") ) ?
validate(d, cv,
"equals", false, p, pf)
119 : ( (t ==
"ae") || (t ==
"almost") ) ?
122 ? (pf?true : str(
"PASSED: '", d,
"'"))
125 "FAILED: '", d,
"'; got '", cv,
126 "', expected to almost equal '", ev,
"'.",
131 : (pf?false : str(
"FAILED: '", d,
"'; unknown test '", t,
"'."));
167 [[
"id",
"identifier"],[
"td",
"description"],[
"vl",
"value-list"]],
169 merge_p([concat(
"id",ids),concat(
"identifier",ids)])
189 ) = !is_undef(v2) && !is_undef(v3) ? [id, td, [v1, v2, v3]]
190 : !is_undef(v2) ? [id, td, [v1, v2]]
307 : str(fn,
"(*)=", ev);
309 lm =
validate( d=vd, cv=fr, t=t, p=p, ev=ev );
311 if ( !
validate( cv=fr, t=t, p=p, ev=ev, pf=
true ) )
317 validate_log( str(
id,
" -skip-: '", fn,
"(", td,
")'") );
361 ) = !is_undef(v2) && !is_undef(v3) ? [id, [td, ev, [v1, v2, v3]]]
362 : !is_undef(v2) ? [id, [td, ev, [v1, v2]]]
363 : [id, [td, ev, [v1]]];
485 : str(fn,
"(*)=", ev);
487 lm =
validate( d=vd, cv=fr, t=t, p=p, ev=ev );
489 if ( !
validate( cv=fr, t=t, p=p, ev=ev, pf=
true ) )
495 validate_log( str(
id,
" -skip-: '", fn,
"(", td,
")'") );
module log_type(t, m)
Output diagnostic message to console.
number_inf
The OpenSCAD inf value (infinity).
number_max
<decimal> The largest representable number in OpenSCAD scripts.
number_min
<decimal> The smallest representable number in OpenSCAD scripts.
function map_validate_init(m, fn)
Create data structure for related map validation functions.
function map_validate_get_fn(db)
Return the test function name.
function validate(d, cv, t, ev, p=4, pf=false)
Compare a computed test value with an known good result.
module table_validate_start(db, verbose=false)
Test data structure db and output the start of test to the test log.
function map_validate_fmt(id, td, ev, v1, v2, v3)
Encode an entry for test map.
module validate_skip(fn)
Output that function named fn has been skipped to the test log.
module map_validate_start(db, verbose=false)
Test data structure db and output the start of test to the test log.
function table_validate_get_v3(db, id)
Return the test argument value 3.
validation_skip
Value signature assignment for log-value results table to skip a test.
function map_validate_get_v2(db, id)
Return the test argument value 2.
function table_validate_get_ids(db)
Return a list of test identifiers in db.
module validate_log(t)
Output text t to the test log.
function table_validate_init(tr, gr)
Create data structure for related table validation functions.
function table_validate_get_v2(db, id)
Return the test argument value 2.
function table_validate_get_ev(db, fn, id)
Return the expected value.
function map_validate_get_td(db, id)
Return the test description.
function map_validate_get_ev(db, id)
Return the expected value.
module table_validate(db, id, fn, argc, fr, t="equals", p=6)
Validate and log a test function return value against its expected value.
module map_validate(db, id, argc, fr, t="equals", p=6)
Validate and log a test function return value against its expected value.
function map_validate_get_v3(db, id)
Return the test argument value 3.
function table_validate_fmt(id, td, v1, v2, v3)
Encode an entry for test table.
function map_validate_get_ids(db)
Return a list of test identifiers in db.
function map_validate_get_v1(db, id)
Return the test argument value 1.
function table_validate_get_v1(db, id)
Return the test argument value 1.
function table_validate_get_td(db, id)
Return the test description.
function third(v)
Return the third element of an iterable value.
function second(v)
Return the second element of an iterable value.
function first(v)
Return the first element of an iterable value.
function almost_eq(v1, v2, p=6)
Test if all elements of two iterable values are sufficiently equal.
function merge_p(v, j=true)
Parallel-merge the iterable elements of a list.
function map_get_value(m, k)
Get the map value associated with a key.
function map_get_keys(m)
Get a list of all map keys.
module map_check(m, verbose=false)
Perform basic format checks on a map and output errors to console.
module table_check(r, c, verbose=false)
Perform basic format checks on a table and output errors to console.
function table_get_row_ids(r)
Form a list of all table row identifiers.
function table_get_value(r, c, ri, ci)
Get the table cell value for a specified row and column identifier.