Created
September 6, 2014 01:31
-
-
Save Evgenus/80a2715efa2e40e49c49 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe("Path merging", () => { | |
it("Simple data", () => { | |
var paths: {[name: string]: string[]} = { | |
"A": ["1", "2", "3", "4", "5"], | |
"B": ["1", "2", "6", "7", "8"], | |
"C": ["1", "2", "6", "7"] | |
}; | |
expect(routing.mergePaths(paths, (s) => s)).to.deep.equal([ | |
{ | |
segment: "1", | |
names: ["A", "B", "C"], | |
children: [ | |
{ | |
segment: "2", | |
names: ["A", "B", "C"], | |
children: [ | |
{ | |
segment: "3", | |
names: ["A"], | |
children: [ | |
{ | |
segment: "4", | |
names: ["A"], | |
children: [ | |
{ | |
segment: "5", | |
names: ["A"], | |
children: [] | |
} | |
] | |
} | |
] | |
}, | |
{ | |
segment: "6", | |
names: ["B", "C"], | |
children: [ | |
{ | |
segment: "7", | |
names: ["B", "C"], | |
children: [ | |
{ | |
segment: "8", | |
names: ["B"], | |
children: [] | |
} | |
] | |
} | |
] | |
} | |
] | |
} | |
] | |
} | |
]); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment