Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion concepts/conditionals/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ You still need to recognize `[` and `test`, because you will see them in other s
There is no special syntax around the CONDITIONAL_COMMANDS.
You may be used to seeing if statements that look like this:

```if
```bash
if [ "$password" = "secure" ]; then
echo "Welcome!"
fi
Expand Down
2 changes: 1 addition & 1 deletion concepts/conditionals/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ You still need to recognize `[` and `test`, because you will see them in other s
There is no special syntax around the CONDITIONAL_COMMANDS.
You may be used to seeing if statements that look like this:

```if
```bash
if [ "$password" = "secure" ]; then
echo "Welcome!"
fi
Expand Down
3 changes: 1 addition & 2 deletions exercises/concept/vehicle-purchase/.docs/hints.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

## General

- Quote your variable expansions in conditional expressions when you use `[` or `test`.
Inside `[[ ... ]]`, variables are not split or glob-expanded, but quoting the right-hand side of `==` makes it match literally.
- Inside `[[ ... ]]`, variables are not split or glob-expanded, but quoting the right-hand side of `==` makes it match literally.
- Read about [conditional constructs][conditional-constructs] in the bash manual, or the track's conditionals concept page.

## 1. Determine if you will need a license
Expand Down
2 changes: 1 addition & 1 deletion exercises/concept/vehicle-purchase/.docs/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ You still need to recognize `[` and `test`, because you will see them in other s
There is no special syntax around the CONDITIONAL_COMMANDS.
You may be used to seeing if statements that look like this:

```if
```bash
if [ "$password" = "secure" ]; then
echo "Welcome!"
fi
Expand Down
9 changes: 9 additions & 0 deletions exercises/concept/vehicle-purchase/vehicle_purchase.bats
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env bats
load bats-extra
declare lines

# bats test_tags=task:1
test_car_needs_a_license() { # @test
Expand Down Expand Up @@ -145,6 +146,14 @@ test_price_for_an_old_vehicle_other_price() { # @test
assert_line --index 2 'Estimated price: 12500'
}

# bats test_tags=task:3
test_price_multiplies_before_dividing() { # @test
run bash vehicle_purchase.sh car 'Ford Pinto' 'Bugatti Veyron' 999 5

assert_success
assert_line --index 2 'Estimated price: 699'
}

# bats test_tags=task:3
test_prints_exactly_three_lines() { # @test
run bash vehicle_purchase.sh car 'Ford Pinto' 'Bugatti Veyron' 1000 5
Expand Down
1 change: 0 additions & 1 deletion exercises/concept/vehicle-purchase/vehicle_purchase.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#
# Add your code below each task comment.
# Each task builds on the previous tasks, so keep the earlier output unchanged.
# Quote your variable expansions when you use `[` or `test`.

# Task 1: print whether a license is needed for this kind of vehicle.

Expand Down
Loading