| 1 |
#!/bin/bash |
| 2 |
|
| 3 |
echo "Testing embedded locale functionality to prevent crates.io regression..." |
| 4 |
INSTALL_DIR="$(pwd)/test-install-dir" |
| 5 |
rm -rf "$INSTALL_DIR" |
| 6 |
mkdir -p "$INSTALL_DIR" |
| 7 |
utilities_to_test=("cp" "mv" "ln") |
| 8 |
|
| 9 |
for util in "${utilities_to_test[@]}"; do |
| 10 |
echo "Testing $util..." |
| 11 |
cargo install --path "src/uu/$util" --root "$INSTALL_DIR" --force --quiet |
| 12 |
binary_path="$INSTALL_DIR/bin/$util" |
| 13 |
help_output=$("$binary_path" --help 2>&1) |
| 14 |
|
| 15 |
# Check for regression indicators |
| 16 |
if echo "$help_output" | grep -q "common-usage"; then |
| 17 |
echo "✗ CRITICAL REGRESSION: $util shows untranslated 'common-usage' key" |
| 18 |
echo "Help output:" |
| 19 |
echo "$help_output" |
| 20 |
exit 1 |
| 21 |
fi |
| 22 |
|
| 23 |
# Verify proper "Usage:" label |
| 24 |
if echo "$help_output" | grep -q "Usage:"; then |
| 25 |
echo "✓ $util shows properly translated 'Usage:' label" |
| 26 |
else |
| 27 |
echo "✗ CRITICAL REGRESSION: $util missing 'Usage:' label" |
| 28 |
echo "Help output:" |
| 29 |
echo "$help_output" |
| 30 |
exit 1 |
| 31 |
fi |
| 32 |
done |
| 33 |
|
| 34 |
echo "All tests passed!" |