Regression-test cases for null-type

This commit is contained in:
John Kerl 2021-05-13 00:11:51 -04:00
parent 04168eb843
commit a4586145ca
11 changed files with 38 additions and 25 deletions

View file

@ -0,0 +1 @@
mlr --json --from regtest/input/nulls.json put '$z=$x+$y'

View file

View file

@ -0,0 +1,6 @@
{
"x": 1,
"n": null,
"y": 3,
"z": 4
}

View file

@ -0,0 +1 @@
mlr --json --from regtest/input/nulls.json put '$z=$n+$y'

View file

View file

@ -0,0 +1,6 @@
{
"x": 1,
"n": null,
"y": 3,
"z": 3
}

View file

@ -0,0 +1 @@
mlr --json --from regtest/input/nulls.json put '$z=$n+$n'

View file

View file

@ -0,0 +1,6 @@
{
"x": 1,
"n": null,
"y": 3,
"z": null
}

View file

@ -0,0 +1,5 @@
{
"x": 1,
"n": null,
"y": 3
}

View file

@ -1,34 +1,11 @@
================================================================
TOP OF LIST:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
JSON null:
* null literal in bnf
* scan-test for json input
* write-test for json output
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* tools/perf:
o https://eng.uber.com/pprof-go-profiler/
o profile mlr --j2x cat mappings.json
o golang static-analysis tool -- ?
* 2121 case:
o ../c/mlr --from s put '$z=1+""'
o ../go/mlr --from s put '$z=1+""'
o array auto-extend:
- fill with absent is not ok
> Miller internal coding error: absent-values should not have been assigned
> cmt mlrval_new.go
- fill with empty results in these situations :(
> https://miller.readthedocs.io/en/latest/reference.html#null-data-empty-and-absent
"Empty values are explicit in the data so they should explicitly affect
accumulations: mlr put '@sum += $x' should accumulate numeric x values
into the sum but an empty x, when encountered in the input data stream,
should make the sum non-numeric."
- fill with ... use JSON_NULL here?
o needs doc-ent for JSON_NULL -- only for JSON user data only only ... except for this
* blockers:
o repifs, for nidx & pprint both
o --d2n commawrong
@ -73,8 +50,6 @@ JSON null:
* cases/dsl-min-max-types: cmp-matrices need to be fixed to follow the advertised rule for mixed types
NUMERICS < BOOL < VOID < STRING
? blocker? json null
* blocker: smart fmtnum
- poor-person's initial version: lld/llx -> d/x; lf/le/lg -> f/e/g ...
- fmtnum
@ -629,3 +604,15 @@ i https://en.wikipedia.org/wiki/Delimiter#Delimiter_collision
* doc for DSL hostname/os/version functions
? ENV as entire string-string map at RHS/LHS -- ?
* mongo examples to doc :D
* doc for array auto-extend:
- fill with absent is not ok
> Miller internal coding error: absent-values should not have been assigned
> cmt mlrval_new.go
- fill with empty results in these situations :(
> https://miller.readthedocs.io/en/latest/reference.html#null-data-empty-and-absent
"Empty values are explicit in the data so they should explicitly affect
accumulations: mlr put '@sum += $x' should accumulate numeric x values
into the sum but an empty x, when encountered in the input data stream,
should make the sum non-numeric."
- use JSON null here
- needs doc-ent for JSON_NULL -- only for JSON user data only only ... except for this