change test expected behavior
This commit is contained in:
parent
0749d4fb41
commit
7973e4927d
2 changed files with 2 additions and 133 deletions
|
|
@ -190,11 +190,7 @@ func testCompileFields(t *testing.T) {
|
||||||
m, err := compile(t, `pq: pq
|
m, err := compile(t, `pq: pq
|
||||||
pq: null`)
|
pq: null`)
|
||||||
assert.Success(t, err)
|
assert.Success(t, err)
|
||||||
assertQuery(t, m, 1, 0, nil, "")
|
assertQuery(t, m, 0, 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")
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
129
testdata/d2ir/TestCompile/fields/null.exp.json
generated
vendored
129
testdata/d2ir/TestCompile/fields/null.exp.json
generated
vendored
|
|
@ -1,131 +1,4 @@
|
||||||
{
|
{
|
||||||
"fields": [
|
"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"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"edges": null
|
"edges": null
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue