๐Ÿ“ฆ Monty / IMDb_xref

๐Ÿ“„ test-xrefCast.sh ยท 83 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83#!/usr/bin/env bash

# Make sure we are in the correct directory
DIRNAME=$(dirname "$0")
cd "$DIRNAME"/.. || exit

source functions/define_colors
source functions/define_files
source functions/load_functions
ensurePrerequisites

# trap ctrl-c and call cleanup
trap cleanup INT
#
function cleanup() {
    unset NO_MENUS
    exit 130
}

export NO_MENUS="yes"

printf "==> Testing ${RED}xrefCast.sh${NO_COLOR}.\n\n"
printf "First, print the help file...\n"
./xrefCast.sh -h
waitUntil -k
clear

while true; do

    if waitUntil "$YN_PREF" -Y '\nRun ./xrefCast.sh "Olivia Colman"'; then
        ./xrefCast.sh "Olivia Colman"
    fi

    if waitUntil "$YN_PREF" -Y '\nRun ./xrefCast.sh "Olivia Colman" "Elizabeth Debicki"'; then
        ./xrefCast.sh "Olivia Colman" "Elizabeth Debicki"
    fi

    if waitUntil "$YN_PREF" -Y '\nRun ./xrefCast.sh -pi "Olivia Colman" "Elizabeth Debicki"'; then
        ./xrefCast.sh -pi "Olivia Colman" "Elizabeth Debicki"
    fi

    if waitUntil "$YN_PREF" -Y '\nRun ./xrefCast.sh "Olivia Colman" "Princess Diana"'; then
        ./xrefCast.sh "Olivia Colman" "Princess Diana"
    fi

    if waitUntil "$YN_PREF" -Y '\nRun ./xrefCast.sh "Queen Elizabeth II" "Princess Diana"'; then
        ./xrefCast.sh "Queen Elizabeth II" "Princess Diana"
    fi

    if waitUntil "$YN_PREF" -Y '\nRun ./xrefCast.sh "Olivia Colman" "The Night Manager"'; then
        ./xrefCast.sh "Olivia Colman" "The Night Manager"
    fi

    if waitUntil "$YN_PREF" -Y '\nRun ./xrefCast.sh "the durrells in corfu" "the night manager"'; then
        ./xrefCast.sh "the durrells in corfu" "the night manager"
    fi

    if waitUntil "$YN_PREF" -Y \
        '\nRun ./xrefCast.sh "The Night Manager" ""The Durrells"'; then
        ./xrefCast.sh "The Night Manager" "The Durrells"
    fi

    printf "==> Verify -d only lists cast members who are in more than one show.\n"

    if waitUntil "$YN_PREF" -Y \
        '\nRun ./xrefCast.sh -d "The Night Manager" "The Crown" "The Durrells"'; then
        ./xrefCast.sh -d "The Night Manager" "The Crown" "The Durrells"
    fi

    if waitUntil "$YN_PREF" -Y '\nRun ./xrefCast.sh'; then
        ./xrefCast.sh
    fi
    if waitUntil "$YN_PREF" -Y '\nRun ./xrefCast.sh aaa'; then
        ./xrefCast.sh aaa
    fi

    ! waitUntil "$YN_PREF" -Y '\nTests completed. Run again?' && break
    printf "\n"

done

unset NO_MENUS