#!/usr/bin/env bash

shopt -s expand_aliases

testBadPyNewlines() {
    prefix=${TWLIGHT_HOME}/tests/shunit/data/bad_i18n_newline_
    for i in ${prefix}*.py
    do
        assertFalse "${file} should cause an error." "perl ${TWLIGHT_HOME}/bin/twlight_i18n_lint.pl ${i}"
    done
}

testGoodPy() {
    prefix=${TWLIGHT_HOME}/tests/shunit/data/good_i18n_
    for i in ${prefix}*.py
    do
        assertTrue "${file} should not cause an error." "perl ${TWLIGHT_HOME}/bin/twlight_i18n_lint.pl ${i}" ||:
    done
}

testBadPyComments() {
    prefix=${TWLIGHT_HOME}/tests/shunit/data/bad_i18n_comment_
    for i in ${prefix}*.py
    do
        assertFalse "${file} should cause an error." "perl ${TWLIGHT_HOME}/bin/twlight_i18n_lint.pl ${i}"
    done
}

. ${TWLIGHT_HOME}/tests/shunit/shunit2

#!/usr/bin/env bash

shopt -s expand_aliases

testBadPyNewlines() {
    start=1
    end=6
    for ((i=$start; i<=$end; i++))
    do
        file=${TWLIGHT_HOME}/tests/shunit/data/bad_i18n_newline_$i.py
        assertFalse "${file} should cause an error." "perl ${TWLIGHT_HOME}/bin/twlight_i18n_lint.pl ${file}"
    done
}

testGoodPy() {
    start=1
    end=2
    for ((i=$start; i<=$end; i++))
    do
        file=${TWLIGHT_HOME}/tests/shunit/data/good_i18n_$i.py
        assertTrue "${file} should not cause an error." "perl ${TWLIGHT_HOME}/bin/twlight_i18n_lint.pl ${file}" ||:
    done
}

testBadPyComments() {
    start=1
    end=2
    for ((i=$start; i<=$end; i++))
    do
        file=${TWLIGHT_HOME}/tests/shunit/data/bad_i18n_comment_$i.py
        assertFalse "${file} should cause an error." "perl ${TWLIGHT_HOME}/bin/twlight_i18n_lint.pl ${file}"
    done
}

. ${TWLIGHT_HOME}/tests/shunit/shunit2

--- 
+++ 
@@ -3,26 +3,32 @@
 shopt -s expand_aliases
 
 testBadPyNewlines() {
-    prefix=${TWLIGHT_HOME}/tests/shunit/data/bad_i18n_newline_
-    for i in ${prefix}*.py
+    start=1
+    end=6
+    for ((i=$start; i<=$end; i++))
     do
-        assertFalse "${file} should cause an error." "perl ${TWLIGHT_HOME}/bin/twlight_i18n_lint.pl ${i}"
+        file=${TWLIGHT_HOME}/tests/shunit/data/bad_i18n_newline_$i.py
+        assertFalse "${file} should cause an error." "perl ${TWLIGHT_HOME}/bin/twlight_i18n_lint.pl ${file}"
     done
 }
 
 testGoodPy() {
-    prefix=${TWLIGHT_HOME}/tests/shunit/data/good_i18n_
-    for i in ${prefix}*.py
+    start=1
+    end=2
+    for ((i=$start; i<=$end; i++))
     do
-        assertTrue "${file} should not cause an error." "perl ${TWLIGHT_HOME}/bin/twlight_i18n_lint.pl ${i}" ||:
+        file=${TWLIGHT_HOME}/tests/shunit/data/good_i18n_$i.py
+        assertTrue "${file} should not cause an error." "perl ${TWLIGHT_HOME}/bin/twlight_i18n_lint.pl ${file}" ||:
     done
 }
 
 testBadPyComments() {
-    prefix=${TWLIGHT_HOME}/tests/shunit/data/bad_i18n_comment_
-    for i in ${prefix}*.py
+    start=1
+    end=2
+    for ((i=$start; i<=$end; i++))
     do
-        assertFalse "${file} should cause an error." "perl ${TWLIGHT_HOME}/bin/twlight_i18n_lint.pl ${i}"
+        file=${TWLIGHT_HOME}/tests/shunit/data/bad_i18n_comment_$i.py
+        assertFalse "${file} should cause an error." "perl ${TWLIGHT_HOME}/bin/twlight_i18n_lint.pl ${file}"
     done
 }
 
Call i18n test data with pattern, not fixed loop.
