From e14bf1f1384aab1a8906cc8c771dc3364514bb1c Mon Sep 17 00:00:00 2001 From: Glenn Jackman Date: Tue, 17 Feb 2026 22:11:29 -0500 Subject: [PATCH] Harden the tests for the `basics` concept exercise --- exercises/concept/basics/passwd | 4 ++-- exercises/concept/basics/test-basics.bats | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/exercises/concept/basics/passwd b/exercises/concept/basics/passwd index 012332a..4b07b10 100644 --- a/exercises/concept/basics/passwd +++ b/exercises/concept/basics/passwd @@ -1,7 +1,7 @@ root:x:0:0:root:/root:/bin/bash john:x:1001:1001:John Doe:/home/john:/bin/bash -jane:x:1002:1002:Jane Doe:/home/jane:/bin/bash -mark:x:1003:1003:Mark Smith:/home/mark:/bin/zsh +mark:x:1002:1002:Mark Smith:/home/mark:/bin/zsh +jane:x:1003:1003:Jane Doe:/home/jane:/bin/bash susan:x:1004:1004:Susan Johnson:/invalid/home:/bin/bash peter:x:1005:1005:Peter Wong:/home/peter:/bin/false bill:x:1006:1004:Bill Gates:/invalid/steve:/usr/local/bin/pwsh diff --git a/exercises/concept/basics/test-basics.bats b/exercises/concept/basics/test-basics.bats index 088d2f4..01856f3 100644 --- a/exercises/concept/basics/test-basics.bats +++ b/exercises/concept/basics/test-basics.bats @@ -8,8 +8,8 @@ load bats-extra assert_success assert_line --index 0 "root" assert_line --index 1 "john" - assert_line --index 2 "jane" - assert_line --index 3 "mark" + assert_line --index 2 "mark" + assert_line --index 3 "jane" assert_line --index 4 "susan" assert_line --index 5 "peter" assert_line --index 6 "bill" @@ -45,5 +45,6 @@ load bats-extra assert_success assert_line --index 16 "root:x:0:0:root:/root:/bin/bash" assert_line --index 17 "john:x:1001:1001:John Doe:/home/john:/bin/bash" - assert_line --index 18 "jane:x:1002:1002:Jane Doe:/home/jane:/bin/bash" + assert_line --index 18 "jane:x:1003:1003:Jane Doe:/home/jane:/bin/bash" + assert_equal "${#lines[@]}" 19 # the whole script should output exactly 19 lines. }