@@ -6,6 +6,7 @@ var VERSION = require('../core/lib/pattern_graph').PATTERN_GRAPH_VERSION;
66var Pattern = require ( '../core/lib/object_factory' ) . Pattern ;
77var CompileState = require ( '../core/lib/object_factory' ) . CompileState ;
88var tap = require ( 'tap' ) ;
9+ const posixPath = require ( './util/test_utils.js' ) . posixPath ;
910
1011var patternlab = {
1112 config : {
@@ -150,7 +151,7 @@ tap.test("Adding two nodes with only different subpattern types", (test) => {
150151 g . add ( atomFoo ) ;
151152 g . add ( moleculeFoo ) ;
152153 var actual = g . nodes ( ) ;
153- test . same ( actual , [ "00-atoms/00-foo/baz.html" , "00-atoms/00-bar/baz.html" ] ) ;
154+ test . same ( posixPath ( actual ) , [ "00-atoms/00-foo/baz.html" , "00-atoms/00-bar/baz.html" ] ) ;
154155 test . end ( ) ;
155156} ) ;
156157
@@ -224,10 +225,10 @@ tap.test("filter() - Removing nodes via filter", (test) => {
224225 g . link ( moleculeBar , atomFoo ) ;
225226
226227 tap . test ( "lineage() - Calculate the lineage of a node" , ( test ) => {
227- test . same ( g . lineage ( organismFoo ) . map ( p => p . relPath ) , [ "01-molecule/xy/foo" ] ) ;
228- test . same ( g . lineage ( organismBar ) . map ( p => p . relPath ) , [ "01-molecule/xy/foo" , "01-molecule/xy/bar" ] ) ;
229- test . same ( g . lineage ( moleculeFoo ) . map ( p => p . relPath ) , [ "00-atom/xy/foo" ] ) ;
230- test . same ( g . lineage ( moleculeBar ) . map ( p => p . relPath ) , [ "00-atom/xy/foo" ] ) ;
228+ test . same ( posixPath ( g . lineage ( organismFoo ) . map ( p => p . relPath ) ) , [ "01-molecule/xy/foo" ] ) ;
229+ test . same ( posixPath ( g . lineage ( organismBar ) . map ( p => p . relPath ) ) , [ "01-molecule/xy/foo" , "01-molecule/xy/bar" ] ) ;
230+ test . same ( posixPath ( g . lineage ( moleculeFoo ) . map ( p => p . relPath ) ) , [ "00-atom/xy/foo" ] ) ;
231+ test . same ( posixPath ( g . lineage ( moleculeBar ) . map ( p => p . relPath ) ) , [ "00-atom/xy/foo" ] ) ;
231232 test . same ( g . lineage ( atomFoo ) . map ( p => p . relPath ) , [ ] ) ;
232233 test . same ( g . lineage ( atomIsolated ) . map ( p => p . relPath ) , [ ] ) ;
233234 test . end ( ) ;
@@ -246,9 +247,9 @@ tap.test("filter() - Removing nodes via filter", (test) => {
246247 tap . test ( "lineageR() - Calculate the reverse lineage of a node" , ( test ) => {
247248 test . same ( g . lineageR ( organismFoo ) . map ( p => p . relPath ) , [ ] ) ;
248249 test . same ( g . lineageR ( organismBar ) . map ( p => p . relPath ) , [ ] ) ;
249- test . same ( g . lineageR ( moleculeFoo ) . map ( p => p . relPath ) , [ "02-organism/xy/foo" , "02-organism/xy/bar" ] ) ;
250- test . same ( g . lineageR ( moleculeBar ) . map ( p => p . relPath ) , [ "02-organism/xy/bar" ] ) ;
251- test . same ( g . lineageR ( atomFoo ) . map ( p => p . relPath ) , [ "01-molecule/xy/foo" , "01-molecule/xy/bar" ] ) ;
250+ test . same ( posixPath ( g . lineageR ( moleculeFoo ) . map ( p => p . relPath ) ) , [ "02-organism/xy/foo" , "02-organism/xy/bar" ] ) ;
251+ test . same ( posixPath ( g . lineageR ( moleculeBar ) . map ( p => p . relPath ) ) , [ "02-organism/xy/bar" ] ) ;
252+ test . same ( posixPath ( g . lineageR ( atomFoo ) . map ( p => p . relPath ) ) , [ "01-molecule/xy/foo" , "01-molecule/xy/bar" ] ) ;
252253 test . same ( g . lineageR ( atomIsolated ) . map ( p => p . relPath ) , [ ] ) ;
253254 test . end ( ) ;
254255 } ) ;
0 commit comments