More consistent formatting
(If only I could point gofmt at everything.)
This commit is contained in:
parent
02eb9d051f
commit
eb3fd17e1d
1 changed files with 30 additions and 34 deletions
|
|
@ -98,73 +98,69 @@ var testQueries = []struct {
|
||||||
message: "show correct null semantics",
|
message: "show correct null semantics",
|
||||||
query: `[{"id": "cool", "status": null}]`,
|
query: `[{"id": "cool", "status": null}]`,
|
||||||
expect: `
|
expect: `
|
||||||
[{"id": "cool", "status": null}]
|
[
|
||||||
|
{"id": "cool", "status": null}
|
||||||
|
]
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
message: "get correct follows list",
|
message: "get correct follows list",
|
||||||
query: `[{"id": "C", "follows": []}]`,
|
query: `[{"id": "C", "follows": []}]`,
|
||||||
expect: `
|
expect: `
|
||||||
[{
|
[
|
||||||
"id": "C",
|
{"id": "C", "follows": ["B", "D"]}
|
||||||
"follows": ["B", "D"]
|
]
|
||||||
}]
|
`,
|
||||||
`,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
message: "get correct reverse follows list",
|
message: "get correct reverse follows list",
|
||||||
query: `[{"id": "F", "!follows": []}]`,
|
query: `[{"id": "F", "!follows": []}]`,
|
||||||
expect: `
|
expect: `
|
||||||
[{
|
[
|
||||||
"id": "F",
|
{"id": "F", "!follows": ["B", "E"]}
|
||||||
"!follows": ["B", "E"]
|
]
|
||||||
}]
|
`,
|
||||||
`,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
message: "get correct follows struct",
|
message: "get correct follows struct",
|
||||||
query: `[{"id": null, "follows": {"id": null, "status": "cool"}}]`,
|
query: `[{"id": null, "follows": {"id": null, "status": "cool"}}]`,
|
||||||
expect: `
|
expect: `
|
||||||
[
|
[
|
||||||
{"id": "A", "follows": {"id": "B", "status": "cool"}},
|
{"id": "A", "follows": {"id": "B", "status": "cool"}},
|
||||||
{"id": "C", "follows": {"id": "D", "status": "cool"}},
|
{"id": "C", "follows": {"id": "D", "status": "cool"}},
|
||||||
{"id": "D", "follows": {"id": "G", "status": "cool"}},
|
{"id": "D", "follows": {"id": "G", "status": "cool"}},
|
||||||
{"id": "F", "follows": {"id": "G", "status": "cool"}}
|
{"id": "F", "follows": {"id": "G", "status": "cool"}}
|
||||||
]
|
]
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
message: "get correct reverse follows struct",
|
message: "get correct reverse follows struct",
|
||||||
query: `[{"id": null, "!follows": [{"id": null, "status" : "cool"}]}]`,
|
query: `[{"id": null, "!follows": [{"id": null, "status" : "cool"}]}]`,
|
||||||
expect: `
|
expect: `
|
||||||
[
|
[
|
||||||
{"id": "F", "!follows": [{"id": "B", "status": "cool"}]},
|
{"id": "F", "!follows": [{"id": "B", "status": "cool"}]},
|
||||||
{"id": "B", "!follows": [{"id": "D", "status": "cool"}]},
|
{"id": "B", "!follows": [{"id": "D", "status": "cool"}]},
|
||||||
{"id": "G", "!follows": [{"id": "D", "status": "cool"}]}
|
{"id": "G", "!follows": [{"id": "D", "status": "cool"}]}
|
||||||
]
|
]
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
message: "get correct co-follows",
|
message: "get correct co-follows",
|
||||||
query: `[{"id": null, "@A:follows": "B", "@B:follows": "D"}]`,
|
query: `[{"id": null, "@A:follows": "B", "@B:follows": "D"}]`,
|
||||||
expect: `
|
expect: `
|
||||||
[{
|
[
|
||||||
"id": "C",
|
{"id": "C", "@A:follows": "B", "@B:follows": "D"}
|
||||||
"@A:follows": "B",
|
]
|
||||||
"@B:follows": "D"
|
|
||||||
}]
|
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
message: "get correct reverse co-follows",
|
message: "get correct reverse co-follows",
|
||||||
query: `[{"id": null, "!follows": {"id": "C"}, "@A:!follows": "D"}]`,
|
query: `[{"id": null, "!follows": {"id": "C"}, "@A:!follows": "D"}]`,
|
||||||
expect: `
|
expect: `
|
||||||
[{
|
[
|
||||||
"id": "B",
|
{"id": "B", "!follows": {"id": "C"}, "@A:!follows": "D"}
|
||||||
"!follows": {"id": "C"},
|
]
|
||||||
"@A:!follows": "D"
|
`,
|
||||||
}]
|
|
||||||
`,
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue