Skip to content

Commit

Permalink
Fix for JENKINS-16942
Browse files Browse the repository at this point in the history
https://issues.jenkins-ci.org/browse/JENKINS-16942

PrintWriter.println() uses the OS specific line separator. When
SecretRewriter rewrites the secret file, the lines are converted to the
format of the running OS.  The test case does not account for this.
Since the test case is coded expecting line endings of \n, this fix
converts \r\n to \n before comparing.
  • Loading branch information
Andrew Mann committed Mar 25, 2013
1 parent f8193f0 commit 899f5aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/test/java/hudson/util/SecretRewriterTest.groovy
Expand Up @@ -52,7 +52,7 @@ class SecretRewriterTest {
def f = File.createTempFile("test", "xml", tmp.root)
f.text = before
sr.rewrite(f,null)
assert after.trim()==f.text.trim()
assert after.replaceAll("\r\n", "\n").trim()==f.text.replaceAll("\r\n", "\n").trim()
}

String encryptOld(str) {
Expand Down

0 comments on commit 899f5aa

Please sign in to comment.