Source

SCons / test / Flatten.py

Diff from to

File test/Flatten.py

 Test that the Flatten() function is available and works.
 """
 
+import string
+
 import TestSCons
 
 test = TestSCons.TestSCons()
 test.write('file2a.in', "file2a.in\n")
 test.write('file2b.in', "file2b.in\n")
 
+def double_backslash(f):
+    p = test.workpath(f)
+    return string.replace(p, '\\', '\\\\')
+
 expect = """\
 ['begin', '%s', 'middle', '%s', 'end']
 ['%s', 'a', 'b', 'c', '%s']
 [1, 2, 3, 4]
 [1, 2, 3, 4]
-""" % (test.workpath('file1.out'), test.workpath('file2.out'),
-       test.workpath('file1.out'), test.workpath('file2.out'))
+""" % (double_backslash('file1.out'), double_backslash('file2.out'),
+       double_backslash('file1.out'), double_backslash('file2.out'))
 
 test.run(chdir = "work",
          arguments = ".",