Commit Graph

7 Commits

Author SHA1 Message Date
Anders Eknert dfd4be45b3 Remove any data attrubutes not used in the "YAML tests" (#4817)
Fixes #4813

Signed-off-by: Anders Eknert <anders@eknert.com>
2022-06-28 10:18:35 +02:00
Torin Sandall af4ad84807 topdown: Fix confusing error message for minus operator (#4090)
Fixes #1643

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2021-12-03 07:19:58 +01:00
Stephan Renatus a6759d40f3 topdown: port big int strings test to yaml testcases (#3208)
Adding the "two obviously different numbers look the same" case, too.

Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
2021-03-03 09:12:29 +01:00
Stephan Renatus 372f07e3b2 wasm: synchronise behaviour with non-strict-builtin-error mode in topdown (#3022)
In topdown, we have two different error modes: strict/non-strict.
In WASM, everything is meant to be non-strict. Thus errors that
only appear in topdown with strict mode are annotated as such,
and checked for an empty result-set in the WASM test runner.

Several WASM builtins that have returned an error where they should
return NULL have been adjusted.

This allows us to fix most of the exceptions brought up in #2954.

Notable pieces:

* wasm sdk: ignore builtin errors

This should be in line with the non-strict builtin error semantics used
in WASM.

Before, when the WASM SDK had called out top a topdown-defined builtin,
and that builtin had returned an error, the WASM caller returned that
error. It's been at odds with how topdown evaluated builtin errors when
run without strict builtin errors.

Now, the errors are properly ignored, except for topdown.Halt. That one
doesn't seem like it's used at the moment, at least from this code base.

* cases: add want_result where non-strict eval yields something

This happens to work for both topdown and wasm:

- in topdown, the test runner checks for expected errors first, and
  ignores the wanted result;
- in wasm, we check for a desired result first, checking the error
  if no result was defined.

Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
2021-01-08 15:25:37 +01:00
Anders Eknert fa94a2d466 Add ceil and floor built-ins
Closes #2930

Signed-off-by: Anders Eknert <anders@eknert.com>
2021-01-07 16:22:41 -05:00
Stephan Renatus f465b227b4 wasm: fix rounding mode
Same as in topdown, we should have this be true in wasm:

    round(1.5) == 2
    round(2.5) == 3

The default rounding mode for libmpdec's maxcontext was MPD_ROUND_HALF_EVEN,
would would round 2.5 to 2.

See https://www.bytereef.org/mpdecimal/doc/libmpdec/context.html#rounding

Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
2020-12-14 09:49:39 -05:00
Torin Sandall 3982a3eac1 test: Move test cases out of topdown package
Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2020-08-20 12:48:20 -04:00