diff --git a/tests/query-parser/common.test.js b/tests/query-parser/common.test.js index 8a5ee8a..9abcf21 100644 --- a/tests/query-parser/common.test.js +++ b/tests/query-parser/common.test.js @@ -1,7 +1,7 @@ import { describe, it } from 'node:test' import assert from '../assert.js' -import { Alias, Identifier, Literal, ObjectPath } from '../../src/query/types.js' -import { baseValue, literal, value } from '../../src/query/common.js' +import { Alias, Identifier, Literal, ObjectPath } from '../../src/query-parser/types.js' +import { baseValue, literal, value } from '../../src/query-parser/common.js' describe('common parser library', () => { const literals = [ diff --git a/tests/query-parser/match.test.js b/tests/query-parser/match.test.js index e239bc7..96d8c6b 100644 --- a/tests/query-parser/match.test.js +++ b/tests/query-parser/match.test.js @@ -1,6 +1,6 @@ import { describe, it } from 'node:test' import assert from '../assert.js' -import { node, edge, matchClause } from '../../src/query/match.js' +import { node, edge, matchClause } from '../../src/query-parser/match.js' import { makeDirectedEdge, makeEdge, makeNode, makeRelationship } from '../utils.js' describe('node', () => { diff --git a/tests/query-parser/query.test.js b/tests/query-parser/query.test.js index fa9a250..48c980f 100644 --- a/tests/query-parser/query.test.js +++ b/tests/query-parser/query.test.js @@ -1,7 +1,7 @@ import { describe, it } from 'node:test' import assert from '../assert.js' -import { query } from '../../src/query/index.js' -import { Alias, Identifier, ObjectPath, Query, ReturnValues, SelectedGraph } from '../../src/query/types.js' +import { query } from '../../src/query-parser/index.js' +import { Alias, Identifier, ObjectPath, Query, ReturnValues, SelectedGraph } from '../../src/query-parser/types.js' import { makeNode, makeRelationship, makeRightEdge } from '../utils.js' const path = (...v) => new ObjectPath(...v) diff --git a/tests/query-parser/return.test.js b/tests/query-parser/return.test.js index 285f922..112ef22 100644 --- a/tests/query-parser/return.test.js +++ b/tests/query-parser/return.test.js @@ -1,7 +1,7 @@ import { describe, it } from 'node:test' import assert from '../assert.js' -import { returnClause } from '../../src/query/return.js' -import { Alias, Identifier, Literal, ReturnValues } from '../../src/query/types.js' +import { returnClause } from '../../src/query-parser/return.js' +import { Alias, Identifier, Literal, ReturnValues } from '../../src/query-parser/types.js' describe('RETURN keyword', () => { it('should collect a single value for a query to return', () => { diff --git a/tests/query-parser/use.test.js b/tests/query-parser/use.test.js index 81bc543..3ade117 100644 --- a/tests/query-parser/use.test.js +++ b/tests/query-parser/use.test.js @@ -1,7 +1,7 @@ import { describe, it } from 'node:test' import assert from '../assert.js' -import { useClause } from '../../src/query/use.js' -import { Identifier } from '../../src/query/types.js' +import { useClause } from '../../src/query-parser/use.js' +import { Identifier } from '../../src/query-parser/types.js' describe('USE keyword', () => { it('should select a graph to query', () => { diff --git a/tests/query.test.js b/tests/query.test.js index cc71517..8885a4a 100644 --- a/tests/query.test.js +++ b/tests/query.test.js @@ -55,7 +55,10 @@ describe('query', () => { const q = 'MATCH (player:Player)-[e1:Knows]->(a:NPC)-[e2:Knows]->(b:NPC) RETURN player, e1, a, e2, b' const result = query(q, engine) - console.log(`parsing ${q}\n`, result.unwrap()) + assert.deepEqual(result.unwrap(), [ + { player: 0, e1: 4, a: 1, e2: 7, b: 2 }, + { player: 0, e1: 4, a: 1, e2: 8, b: 3 } + ]) }) }) diff --git a/tests/utils.js b/tests/utils.js index 69ca0ec..58d247f 100644 --- a/tests/utils.js +++ b/tests/utils.js @@ -1,4 +1,4 @@ -import { KeyValuePair, Name, Label, Identifier, Literal, Edge, Node, DirectedEdge, Relationship } from '../src/query/types.js' +import { KeyValuePair, Name, Label, Identifier, Literal, Edge, Node, DirectedEdge, Relationship } from '../src/query-parser/types.js' export const keyValuePair = ([k, v]) => new KeyValuePair(new Name(new Identifier(k)), new Literal(v))