Code

Merge branch 'maint'
[git.git] / t / test-lib.sh
index baa4093073564e081dcf6bc692910257663c9b03..afd3053f96b789a73274217b384d245583500c04 100644 (file)
@@ -230,6 +230,22 @@ test_decode_color () {
                -e 's/.\[m/<RESET>/g'
 }
 
+q_to_nul () {
+       perl -pe 'y/Q/\000/'
+}
+
+q_to_cr () {
+       tr Q '\015'
+}
+
+append_cr () {
+       sed -e 's/$/Q/' | tr Q '\015'
+}
+
+remove_cr () {
+       tr '\015' Q | sed -e 's/Q$//'
+}
+
 test_tick () {
        if test -z "${test_tick+set}"
        then