From 7973e4927d9d0f73be66fc19680e8268e856c41c Mon Sep 17 00:00:00 2001 From: Alexander Wang Date: Tue, 27 Jun 2023 13:36:33 -0700 Subject: [PATCH] change test expected behavior --- d2ir/compile_test.go | 6 +- .../d2ir/TestCompile/fields/null.exp.json | 129 +----------------- 2 files changed, 2 insertions(+), 133 deletions(-) diff --git a/d2ir/compile_test.go b/d2ir/compile_test.go index 516c42be4..ab7173c8e 100644 --- a/d2ir/compile_test.go +++ b/d2ir/compile_test.go @@ -190,11 +190,7 @@ func testCompileFields(t *testing.T) { m, err := compile(t, `pq: pq pq: null`) assert.Success(t, err) - assertQuery(t, m, 1, 0, nil, "") - // null doesn't delete pq from *Map so that for language tooling - // we maintain the references. - // Instead d2compiler will ensure it doesn't get rendered. - assertQuery(t, m, 0, 0, nil, "pq") + assertQuery(t, m, 0, 0, nil, "") }, }, } diff --git a/testdata/d2ir/TestCompile/fields/null.exp.json b/testdata/d2ir/TestCompile/fields/null.exp.json index 022cb550c..e7db96e23 100644 --- a/testdata/d2ir/TestCompile/fields/null.exp.json +++ b/testdata/d2ir/TestCompile/fields/null.exp.json @@ -1,131 +1,4 @@ { - "fields": [ - { - "name": "pq", - "primary": { - "value": { - "range": "TestCompile/fields/null.d2,1:4:11-1:8:15" - } - }, - "references": [ - { - "string": { - "range": "TestCompile/fields/null.d2,0:0:0-0:2:2", - "value": [ - { - "string": "pq", - "raw_string": "pq" - } - ] - }, - "key_path": { - "range": "TestCompile/fields/null.d2,0:0:0-0:2:2", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/fields/null.d2,0:0:0-0:2:2", - "value": [ - { - "string": "pq", - "raw_string": "pq" - } - ] - } - } - ] - }, - "context": { - "edge": null, - "key": { - "range": "TestCompile/fields/null.d2,0:0:0-0:6:6", - "key": { - "range": "TestCompile/fields/null.d2,0:0:0-0:2:2", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/fields/null.d2,0:0:0-0:2:2", - "value": [ - { - "string": "pq", - "raw_string": "pq" - } - ] - } - } - ] - }, - "primary": {}, - "value": { - "unquoted_string": { - "range": "TestCompile/fields/null.d2,0:4:4-0:6:6", - "value": [ - { - "string": "pq", - "raw_string": "pq" - } - ] - } - } - } - } - }, - { - "string": { - "range": "TestCompile/fields/null.d2,1:0:7-1:2:9", - "value": [ - { - "string": "pq", - "raw_string": "pq" - } - ] - }, - "key_path": { - "range": "TestCompile/fields/null.d2,1:0:7-1:2:9", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/fields/null.d2,1:0:7-1:2:9", - "value": [ - { - "string": "pq", - "raw_string": "pq" - } - ] - } - } - ] - }, - "context": { - "edge": null, - "key": { - "range": "TestCompile/fields/null.d2,1:0:7-1:8:15", - "key": { - "range": "TestCompile/fields/null.d2,1:0:7-1:2:9", - "path": [ - { - "unquoted_string": { - "range": "TestCompile/fields/null.d2,1:0:7-1:2:9", - "value": [ - { - "string": "pq", - "raw_string": "pq" - } - ] - } - } - ] - }, - "primary": {}, - "value": { - "null": { - "range": "TestCompile/fields/null.d2,1:4:11-1:8:15" - } - } - } - } - } - ] - } - ], + "fields": [], "edges": null }