public void testExtensiveWithAbsolutePrefix() throws IOException { // Inputs are /b/c/<every possible 10-character string of characters "a./"> // Expected outputs are from realpath -s. doExtensiveTest("testdata/simplifypathwithabsoluteprefixtests.txt"); }
public void testExtensiveNoPrefix() throws IOException { /* * Inputs are <every possible 10-character string of characters "a./"> * * Expected outputs are generated by the code itself, but they've been * checked against the inputs under Bash in order to confirm that the two * forms are equivalent (though not necessarily minimal, though we hope this * to be the case). Thus, this test is more of a regression test. * * Rough instructions to regenerate the test outputs and verify correctness: * - Temporarily change this test: * --- Comment out assertEquals. * --- System.out.println(input + " " + simplifyPath(input)); * --- fail(). (If the test were to pass, its output would be hidden.) * - Run the test. * - Pull the relevant lines of output from the test into a testcases file. * - Test the output: * --- cat testcases | while read L; do * X=($L) * A=$( cd /b/c && sudo mkdir -p ${X[0]} && cd ${X[0]} && pwd | * sed -e 's#^//*#/#' ) * B=$( cd /b/c && cd ${X[1]} && pwd ) * cmp -s <(echo $A) <(echo $B) || echo "$X[0] -> $A vs. $B" * done | tee testoutput * - Move that testcases file to the appropriate name under testdata. * * The last test will take hours, and if it passes, the output will be empty. */ doExtensiveTest("testdata/simplifypathnoprefixtests.txt"); }
public void testExtensiveWithAbsolutePrefix() throws IOException { // Inputs are /b/c/<every possible 10-character string of characters "a./"> // Expected outputs are from realpath -s. doExtensiveTest("testdata/simplifypathwithabsoluteprefixtests.txt"); }
public void testExtensiveNoPrefix() throws IOException { /* * Inputs are <every possible 10-character string of characters "a./"> * * Expected outputs are generated by the code itself, but they've been * checked against the inputs under Bash in order to confirm that the two * forms are equivalent (though not necessarily minimal, though we hope this * to be the case). Thus, this test is more of a regression test. * * Rough instructions to regenerate the test outputs and verify correctness: * - Temporarily change this test: * --- Comment out assertEquals. * --- System.out.println(input + " " + simplifyPath(input)); * --- fail(). (If the test were to pass, its output would be hidden.) * - Run the test. * - Pull the relevant lines of output from the test into a testcases file. * - Test the output: * --- cat testcases | while read L; do * X=($L) * A=$( cd /b/c && sudo mkdir -p ${X[0]} && cd ${X[0]} && pwd | * sed -e 's#^//*#/#' ) * B=$( cd /b/c && cd ${X[1]} && pwd ) * cmp -s <(echo $A) <(echo $B) || echo "$X[0] -> $A vs. $B" * done | tee testoutput * - Move that testcases file to the appropriate name under testdata. * * The last test will take hours, and if it passes, the output will be empty. */ doExtensiveTest("testdata/simplifypathnoprefixtests.txt"); }