Skip to content
Merged
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
8 changes: 4 additions & 4 deletions docs/common-patterns.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ function test_insert_record() {
create_table "users"
insert_record "users" "john@example.com"

assert_file_contains "john@example.com" "$TEST_DB/users.txt"
assert_file_contains "$TEST_DB/users.txt" "john@example.com"
}
```
:::
Expand Down Expand Up @@ -252,9 +252,9 @@ function test_log_creates_file() {
function test_log_writes_timestamp_and_message() {
log_message "Error occurred" "$TEST_LOG"

assert_file_contains "Error occurred" "$TEST_LOG"
assert_file_contains "$TEST_LOG" "Error occurred"
# Check for timestamp pattern (YYYY-MM-DD HH:MM:SS)
assert_matches "[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}" "$TEST_LOG"
assert_matches "[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}" "$(cat "$TEST_LOG")"
}

function test_log_appends_multiple_messages() {
Expand Down Expand Up @@ -659,7 +659,7 @@ function tear_down() {
function test_create_user() {
create_test_user "John Doe" "john@example.com"

assert_file_contains "John Doe" "$TEST_DB/users.csv"
assert_file_contains "$TEST_DB/users.csv" "John Doe"
}
```
:::
Expand Down
Loading