Files
languageservices/expressions/src/data/dictionary.test.ts
T

20 lines
562 B
TypeScript
Raw Normal View History

2023-01-09 19:02:19 -05:00
import {Dictionary} from "./dictionary";
import {StringData} from "./string";
describe("dictionary", () => {
it("pairs contains all values", () => {
const d = new Dictionary();
d.add("ABC", new StringData("val"));
2023-01-09 19:02:19 -05:00
expect(d.pairs()).toEqual([{key: "ABC", value: new StringData("val")}]);
});
2023-01-09 14:03:56 -08:00
it("does not add duplicate entries", () => {
const d = new Dictionary();
d.add("ABC", new StringData("val1"));
d.add("abc", new StringData("val2"));
2023-01-09 19:02:19 -05:00
expect(d.pairs()).toEqual([{key: "ABC", value: new StringData("val1")}]);
2023-01-09 14:03:56 -08:00
});
});