|
| 1 | +#!/usr/bin/env bash |
| 2 | +# ghe-rsync-feature-checker command tests |
| 3 | + |
| 4 | +TESTS_DIR="$PWD/$(dirname "$0")" |
| 5 | +# Bring in testlib. |
| 6 | +# shellcheck source=test/testlib.sh |
| 7 | +. "$TESTS_DIR/testlib.sh" |
| 8 | + |
| 9 | +## testing for known supported command help with and without leading dashes |
| 10 | + |
| 11 | +begin_test "Testing ghe-rsync-feature-checker for known supported command --help" |
| 12 | +( |
| 13 | + set -e |
| 14 | + |
| 15 | + # Test ghe-rsync-feature-checker command |
| 16 | + ghe-rsync-feature-checker --help | grep -q "true" |
| 17 | +) |
| 18 | +end_test |
| 19 | + |
| 20 | +begin_test "Testing ghe-rsync-feature-checker with known supported command help" |
| 21 | +( |
| 22 | + set -e |
| 23 | + |
| 24 | + # Test ghe-rsync-feature-checker command |
| 25 | + ghe-rsync-feature-checker help | grep -q "true" |
| 26 | +) |
| 27 | +end_test |
| 28 | + |
| 29 | +## testing with known unsupported command not-an-actual-feature with and without leading dashes |
| 30 | + |
| 31 | +begin_test "Testing ghe-rsync-feature-checker with known unsupported command --not-an-actual-feature" |
| 32 | +( |
| 33 | + set -e |
| 34 | + |
| 35 | + # Test ghe-rsync-feature-checker command |
| 36 | + ghe-rsync-feature-checker --not-an-actual-feature | grep -q "false" |
| 37 | + |
| 38 | +) |
| 39 | +end_test |
| 40 | + |
| 41 | +begin_test "Testing ghe-rsync-feature-checker with known unsupported command not-an-actual-feature" |
| 42 | +( |
| 43 | + set -e |
| 44 | + |
| 45 | + # Test ghe-rsync-feature-checker command |
| 46 | + ghe-rsync-feature-checker not-an-actual-feature | grep -q "false" |
| 47 | +) |
| 48 | +end_test |
| 49 | + |
| 50 | +## testing with known supported command partial with and without leading dashes |
| 51 | + |
| 52 | +begin_test "Testing ghe-rsync-feature-checker with known supported command --partial" |
| 53 | +( |
| 54 | + set -e |
| 55 | + |
| 56 | + # Test ghe-rsync-feature-checker command |
| 57 | + ghe-rsync-feature-checker --partial | grep -q "true" |
| 58 | +) |
| 59 | +end_test |
| 60 | + |
| 61 | +begin_test "Testing ghe-rsync-feature-checker with known supported command partial" |
| 62 | +( |
| 63 | + set -e |
| 64 | + |
| 65 | + # Test ghe-rsync-feature-checker command |
| 66 | + ghe-rsync-feature-checker partial | grep -q "true" |
| 67 | +) |
| 68 | +end_test |
| 69 | + |
| 70 | +## testing with known supported command -v with and without leading dashes |
| 71 | + |
| 72 | +begin_test "Testing ghe-rsync-feature-checker with known supported command -v" |
| 73 | +( |
| 74 | + set -e |
| 75 | + |
| 76 | + # Test ghe-rsync-feature-checker command |
| 77 | + ghe-rsync-feature-checker -v | grep -q "true" |
| 78 | +) |
| 79 | +end_test |
| 80 | + |
| 81 | +begin_test "Testing ghe-rsync-feature-checker with known supported command v" |
| 82 | +( |
| 83 | + set -e |
| 84 | + |
| 85 | + # Test ghe-rsync-feature-checker command |
| 86 | + ghe-rsync-feature-checker v | grep -q "true" |
| 87 | +) |
| 88 | +end_test |
| 89 | + |
| 90 | +## testing with known supported command --verbose with and without leading dashes |
| 91 | + |
| 92 | +begin_test "Testing ghe-rsync-feature-checker with known supported command --verbose" |
| 93 | +( |
| 94 | + set -e |
| 95 | + |
| 96 | + # Test ghe-rsync-feature-checker command |
| 97 | + ghe-rsync-feature-checker --verbose | grep -q "true" |
| 98 | +) |
| 99 | +end_test |
| 100 | + |
| 101 | +begin_test "Testing ghe-rsync-feature-checker with known supported command verbose" |
| 102 | +( |
| 103 | + set -e |
| 104 | + |
| 105 | + # Test ghe-rsync-feature-checker command |
| 106 | + ghe-rsync-feature-checker verbose | grep -q "true" |
| 107 | +) |
| 108 | +end_test |
| 109 | + |
| 110 | +## testing with known supported command ignore-missing-args with and without leading dashes |
| 111 | + |
| 112 | +begin_test "Testing ghe-rsync-feature-checker with known supported command --ignore-missing-args" |
| 113 | +( |
| 114 | + set -e |
| 115 | + |
| 116 | + # Test ghe-rsync-feature-checker command |
| 117 | + ghe-rsync-feature-checker "--ignore-missing-args" | grep -q "true" |
| 118 | +) |
| 119 | +end_test |
| 120 | + |
| 121 | +begin_test "Testing ghe-rsync-feature-checker with known supported command ignore-missing-args" |
| 122 | +( |
| 123 | + set -e |
| 124 | + |
| 125 | + # Test ghe-rsync-feature-checker command |
| 126 | + ghe-rsync-feature-checker "ignore-missing-args" | grep -q "true" |
| 127 | +) |
| 128 | +end_test |
0 commit comments