Skip to content

Commit 367f5f5

Browse files
author
Hsieh Chin Fan
authored
Fix build error (#215)
* Fix test condition for taste The order of 3 possible tastes may changes, use pattern instead. * Fix test condition for weather Format of first line is like: Weather report: 24.9016,119.5491 Fix the pattern
1 parent 43a7017 commit 367f5f5

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

tests/taste.bats

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,11 @@ setup() {
6161

6262
# order of ouput lines changed
6363
[[ "$status" -eq 0 ]]
64+
expected='(G-Unit|The Game|Lloyd Banks): .+'
6465
[ "${lines[0]}" = "===================================" ]
65-
[ "${lines[1]}" = "G-Unit: music" ]
66-
[ "${lines[2]}" = "The Game: music" ]
67-
[ "${lines[3]}" = "Lloyd Banks: music" ]
66+
[[ "${lines[1]}" =~ ${expected} ]]
67+
[[ "${lines[2]}" =~ ${expected} ]]
68+
[[ "${lines[3]}" =~ ${expected} ]]
6869
[ "${lines[4]}" = "===================================" ]
6970
}
7071

tests/weather.bats

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ setup() {
5151
run "${TOOL_DIR}/${TOOL_NAME}"
5252

5353
[[ "$status" -eq 0 ]]
54-
expected='Weather report: Lat'
55-
[[ "${lines[0]}" =~ "${expected}" ]]
54+
expected='Weather report: .+'
55+
[[ "${lines[0]}" =~ ${expected} ]]
5656
}
5757

5858
@test "Get the tools version with -v" {

0 commit comments

Comments
 (0)