Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/sh
# Usage: convert_assertions.sh file1 file2 ...
perl -i -p \
-e 's/assertEquals?/assertEquals/g;' \
-e 's/assertNotEquals?/assertNotEquals/g;' \
-e 's/assertPattern/assertRegExp/g;' \
-e 's/assertIdentical/assertSame/g;' \
-e 's/assertNotIdentical/assertNotSame/g;' \
-e 's/assertNoPattern/assertNotRegExp/g;' \
-e 's/assertReference/assertSame/g;' \
-e 's/assertClone/assertEquals/g;' \
-e 's/assertIsA\((\S+), *(\S+)\)/assertInstanceOf(\2, \1)/g;' \
-e 's/skipIf\(\s*true\s*, *(.+)\)/markTestSkipped(\1)/g;' \
-e 's/expectException/setExpectedException/g;' \
"$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.