@@ -6,6 +6,7 @@ var VERSION = require('../core/lib/pattern_graph').PATTERN_GRAPH_VERSION;
6
6
var Pattern = require ( '../core/lib/object_factory' ) . Pattern ;
7
7
var CompileState = require ( '../core/lib/object_factory' ) . CompileState ;
8
8
var tap = require ( 'tap' ) ;
9
+ const posixPath = require ( './util/test_utils.js' ) . posixPath ;
9
10
10
11
var patternlab = {
11
12
config : {
@@ -150,7 +151,7 @@ tap.test("Adding two nodes with only different subpattern types", (test) => {
150
151
g . add ( atomFoo ) ;
151
152
g . add ( moleculeFoo ) ;
152
153
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" ] ) ;
154
155
test . end ( ) ;
155
156
} ) ;
156
157
@@ -224,10 +225,10 @@ tap.test("filter() - Removing nodes via filter", (test) => {
224
225
g . link ( moleculeBar , atomFoo ) ;
225
226
226
227
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" ] ) ;
231
232
test . same ( g . lineage ( atomFoo ) . map ( p => p . relPath ) , [ ] ) ;
232
233
test . same ( g . lineage ( atomIsolated ) . map ( p => p . relPath ) , [ ] ) ;
233
234
test . end ( ) ;
@@ -246,9 +247,9 @@ tap.test("filter() - Removing nodes via filter", (test) => {
246
247
tap . test ( "lineageR() - Calculate the reverse lineage of a node" , ( test ) => {
247
248
test . same ( g . lineageR ( organismFoo ) . map ( p => p . relPath ) , [ ] ) ;
248
249
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" ] ) ;
252
253
test . same ( g . lineageR ( atomIsolated ) . map ( p => p . relPath ) , [ ] ) ;
253
254
test . end ( ) ;
254
255
} ) ;
0 commit comments