Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
phschaad committed Sep 4, 2024
1 parent a958160 commit cdbe767
Show file tree
Hide file tree
Showing 9 changed files with 2,542 additions and 468 deletions.
387 changes: 206 additions & 181 deletions jest.config.ts

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions mocks/monaco-editor.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
editor: {
tokenize: (..._args: any) => {
return [];
},
},
Position: {},
};
490 changes: 488 additions & 2 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,15 @@
"@typescript-eslint/eslint-plugin": "^6.15.0",
"@typescript-eslint/parser": "^6.15.0",
"autoprefixer": "^10.4.13",
"babel-jest": "^29.6.1",
"babel-jest": "^29.7.0",
"babel-loader": "^9.1.3",
"babel-plugin-transform-class-properties": "^6.24.1",
"css-loader": "^6.8.1",
"eslint": "^8.31.0",
"file-loader": "^6.2.0",
"jest": "^29.6.1",
"jest-canvas-mock": "^2.5.2",
"jest-environment-jsdom": "^29.7.0",
"monaco-editor-webpack-plugin": "^7.1.0",
"node-sass": "^9.0.0",
"postcss-loader": "^7.3.3",
Expand Down
8 changes: 5 additions & 3 deletions src/sdfg_diff_viewr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,11 @@ export abstract class SDFGDiffViewer implements ISDFV {
const bKeys = new Set(elementsDictB.keys());

const changedKeys: Set<string> = new Set();
const addedKeys = bKeys.difference(aKeys);
const removedKeys = aKeys.difference(bKeys);
const remainingKeys = aKeys.difference(removedKeys);
const addedKeys = new Set([...bKeys].filter(x => !aKeys.has(x)));
const removedKeys = new Set([...aKeys].filter(x => !bKeys.has(x)));
const remainingKeys = new Set(
[...aKeys].filter(x => !removedKeys.has(x))
);

for (const key of remainingKeys) {
const elA: JsonSDFGElement = elementsDictA.get(key);
Expand Down
Loading

0 comments on commit cdbe767

Please sign in to comment.