d01 ex04 erreur saute des find possibles

This commit is contained in:
Hugo LAMY
2022-02-07 19:27:30 +01:00
parent dc144127a9
commit ea0f9b085a
12 changed files with 40 additions and 9 deletions

View File

@@ -1,4 +1,5 @@
#!/bin/bash
cd $(dirname $0)
source ./colors.sh
mkdir -p test_log
@@ -13,9 +14,9 @@ mkdir -p test_log
OUTPUT=$( cat $TESTNAME.replace )
if [ "$OUTPUT" == "$RESULT" ]
then
echo -e $B_GREEN"test1 success"$ENDCO
echo -e $B_GREEN"$TESTNAME success"$ENDCO
else
echo -e $B_RED"test1 faillure"$ENDCO
echo -e $B_RED"$TESTNAME faillure"$ENDCO
fi
mv $TESTNAME $TESTNAME.replace ./test_log
@@ -65,7 +66,7 @@ EOF
)
run_tests
# TEST 3 ########################################
# TEST 4 ########################################
TESTNAME="test4"
FIND=".."
REPLACEMENT="++"
@@ -81,3 +82,17 @@ EOF
)
run_tests
# TEST 5 ########################################
TESTNAME="test5"
FIND="mdr"
REPLACEMENT="|||"
CONTENT=$(cat << EOF
test de mmdr foubar
EOF
)
RESULT=$(cat << EOF
test de m||| foubar
EOF
)
run_tests

View File

@@ -1 +1 @@
hello
hello

View File

@@ -1 +1 @@
+
++++++++++++++++++++++++++++++++++++++++++++++++++++;

View File

@@ -0,0 +1 @@
test de mmdr foubar

View File

@@ -0,0 +1 @@
test de mmdr foubar