37 lines
849 B
Plaintext
37 lines
849 B
Plaintext
|
#!/bin/bash
|
||
|
# Auteur: Denis Payet
|
||
|
|
||
|
source ${LIBSH}/libeval.sh
|
||
|
|
||
|
#-----------------------------------------
|
||
|
rep=/home/alice/Sequence4/A45
|
||
|
challenge=C45Q2
|
||
|
scriptname=reverse.sh
|
||
|
#---------------------------------
|
||
|
# Debut
|
||
|
firstcheck
|
||
|
|
||
|
# working
|
||
|
$rep/$scriptname banane fraise ananas mangue &>/dev/null
|
||
|
step $(vraifaux $?) "L'execution du script s'effectue sans erreur " true
|
||
|
|
||
|
# display
|
||
|
display=$($rep/$scriptname banane fraise ananas mangue 2>/dev/null)
|
||
|
[ -n "$display" ]
|
||
|
step $(vraifaux $?) "Un resultat s'affiche"
|
||
|
|
||
|
# !selecteur
|
||
|
grep -q selecteur $rep/$scriptname 2>/dev/null
|
||
|
[ $? -ne Ø ]
|
||
|
step $(vraifaux $?) "Le script définit une fonction selecteur "
|
||
|
|
||
|
# accuracy
|
||
|
$rep/$scriptname A B C 2>&1 | grep -q "C B A" >/dev/null
|
||
|
step $(vraifaux $?) "Le resultat est inverse "
|
||
|
|
||
|
#--------------------------------
|
||
|
# Fin
|
||
|
status "${challenge}_$res"
|
||
|
|
||
|
exit 0
|