5 readonly TEST_FILES
='test/input/po';
8 # $ for file in test/po/*; do
10 # I18N_TEMPLATE_FILE="$file" node index validate > "test/output/po/$(basename "$file")";
16 for file in "$TEST_FILES"/*; do
18 echo "[~] validate ${file}";
20 local expectedFile
="$(sed 's/input/output/' <<< "$file")";
21 local output
="$(FORCE_COLOR=0 I18N_TEMPLATE_FILE="$file" node index validate)";
22 local expectedOutput
="$(cat "$expectedFile")";
24 if [ "$expectedOutput" != "$output" ]; then
26 echo -e " 💥 \e[1m\e[31mError\e[39m\e[0m wrong output for ${file}"
27 echo -e "\e[4m🤖 Output\e[0m:"
28 echo "$(echo "$output")";
30 echo -e "\e[4m🤖 Expected\e[0m:"
31 echo "$expectedOutput";
34 echo '-----------------[DIFF]-----------------------'
36 diff -rupP <(echo "$output") <(echo "$expectedOutput")
38 echo '-----------------[/DIFF]-----------------------'
41 echo -e "\e[32m ✔ lint translations for ${file}\e[0m";