@@ -89,25 +89,22 @@ object PathRefTests extends TestSuite {
8989 }
9090
9191 test(" json" ) {
92- def check (quick : Boolean ) = withTmpDir { outDir =>
93- withTmpDir { tmpDir =>
94- val file = tmpDir / " foo.txt"
95- os.write(file, " hello" )
96- val pr = PathRef (file, quick)
97- val prFile =
98- pr.path.toString().replace(outDir.toString(), " $MILL_OUT" ).replace(" \\ " , " \\\\ " )
99- val json = upickle.write(pr)
100- if (quick) {
101- assert(json.startsWith(""" "qref:v0:""" ))
102- assert(json.endsWith(s """ : ${prFile}" """ ))
103- } else {
104- val hash = if (Properties .isWin) " 86df6a6a" else " 4c7ef487"
105- val expected = s """ "ref:v0: ${hash}: ${prFile}" """
106- assert(json == expected)
107- }
108- val pr1 = upickle.read[PathRef ](json)
109- assert(pr == pr1)
92+ def check (quick : Boolean ) = withTmpDir { tmpDir =>
93+ val file = tmpDir / " foo.txt"
94+ os.write(file, " hello" )
95+ val pr = PathRef (file, quick)
96+ val prFile = pr.path.toString().replace(" \\ " , " \\\\ " )
97+ val json = upickle.write(pr)
98+ if (quick) {
99+ assert(json.startsWith(""" "qref:v0:""" ))
100+ assert(json.endsWith(s """ : ${prFile}" """ ))
101+ } else {
102+ val hash = if (Properties .isWin) " 86df6a6a" else " 4c7ef487"
103+ val expected = s """ "ref:v0: ${hash}: ${prFile}" """
104+ assert(json == expected)
110105 }
106+ val pr1 = upickle.read[PathRef ](json)
107+ assert(pr == pr1)
111108 }
112109
113110 test(" qref" ) - check(quick = true )
0 commit comments