Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
tantaman committed Apr 1, 2024
1 parent 0dd0674 commit b9b303c
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
8 changes: 7 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
},
"prettier": "@rocicorp/prettier-config",
"dependencies": {
"@vlcn.io/ds-and-algos": "^3.0.2"
"@vlcn.io/ds-and-algos": "^3.0.2",
"compare-utf8": "^0.1.1"
}
}
3 changes: 2 additions & 1 deletion src/zql/ast-to-ivm/pipeline-builder.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {makeTestContext} from '../context/context.js';
import {Materialite} from '../ivm/materialite.js';
import {EntityQuery, astForTesting as ast} from '../query/entity-query.js';
import {buildPipeline} from './pipeline-builder.js';
import {compareUTF8} from 'compare-utf8';

const e1 = z.object({
id: z.string(),
Expand All @@ -15,7 +16,7 @@ const e1 = z.object({
type E1 = z.infer<typeof e1>;

const context = makeTestContext();
const comparator = (l: E1, r: E1) => l.id.localeCompare(r.id);
const comparator = (l: E1, r: E1) => compareUTF8(l.id, r.id);
test('A simple select', () => {
const q = new EntityQuery<{fields: E1}>(context, 'e1');
const m = new Materialite();
Expand Down
3 changes: 2 additions & 1 deletion src/zql/context/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {Materialite} from '../ivm/materialite.js';
import {Source} from '../ivm/source/source.js';
import {Entity} from '../../generate.js';
import {Ordering} from '../ast/ast.js';
import {compareUTF8} from 'compare-utf8';

/**
* Used to integrate with the host environment.
Expand All @@ -22,7 +23,7 @@ export function makeTestContext(): Context {
if (!sources.has(name)) {
sources.set(
name,
materialite.newSetSource<T>((l, r) => l.id.localeCompare(r.id)),
materialite.newSetSource<T>((l, r) => compareUTF8(l.id, r.id)),
);
}
return sources.get(name)! as Source<T>;
Expand Down
2 changes: 1 addition & 1 deletion src/zql/ivm/graph/operators/operator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export interface Operator {
}

export class NoOp implements Operator {
readonly #inputs;
readonly #inputs: DifferenceStreamReader<unknown>[];

constructor(...input: DifferenceStreamReader<unknown>[]) {
this.#inputs = input;
Expand Down

0 comments on commit b9b303c

Please sign in to comment.