#!/bin/bash # -*- coding: utf-8 -*- # Test file for: _clear_archive.sh THIS_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" ROOT_DIR="$(realpath "$THIS_DIR/../..")" # Test counter TESTS_RUN=0 TESTS_PASSED=0 TESTS_FAILED=0 # Colors GREEN='\033[0;32m' RED='\033[0;31m' NC='\033[0m' assert_success() { local cmd="$1" local desc="${2:-$cmd}" ((TESTS_RUN++)) if eval "$cmd" > /dev/null 2>&1; then echo -e "${GREEN}✓${NC} $desc" ((TESTS_PASSED++)) else echo -e "${RED}✗${NC} $desc" ((TESTS_FAILED++)) fi } assert_file_exists() { local file="$1" ((TESTS_RUN++)) if [ -f "$file" ]; then echo -e "${GREEN}✓${NC} File exists: $file" ((TESTS_PASSED++)) else echo -e "${RED}✗${NC} File missing: $file" ((TESTS_FAILED++)) fi } # Add your tests here test_placeholder() { echo "TODO: Add tests for _clear_archive.sh" } # Run tests main() { echo "Testing: _clear_archive.sh" echo "========================================" test_placeholder echo "========================================" echo "Results: $TESTS_PASSED/$TESTS_RUN passed" [ $TESTS_FAILED -gt 0 ] && exit 1 exit 0 } main "$@" # -------------------------------------------------------------------------------- # Start of Source Code from: /home/ywatanabe/proj/scitex-writer/scripts/shell/modules/utils/_clear_archive.sh # -------------------------------------------------------------------------------- # #!/bin/bash # # echo -e "$0 ..." # # rm compiled_v* diff_v* -f # mv old .old/old-$(date +%s) # # ## EOF # -------------------------------------------------------------------------------- # End of Source Code from: /home/ywatanabe/proj/scitex-writer/scripts/shell/modules/utils/_clear_archive.sh # --------------------------------------------------------------------------------