Skip to content

Commit

Permalink
Rename 'has-valid-header' to 'has-valid-ar-header'. (#17)
Browse files Browse the repository at this point in the history
The ar package is typically imported with `show *`, and not having the
'ar' in the name is unhelpful.
  • Loading branch information
floitsch authored Nov 13, 2024
1 parent 0d54dd4 commit 66f0359
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/ar.toit
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ DETERMINISTIC-MODE_ ::= 0b110_100_100 // Octal 644.
/**
Whether the given $bytes start with an AR header.
*/
has-valid-header bytes/ByteArray -> bool:
has-valid-ar-header bytes/ByteArray -> bool:
return bytes.size >= AR-HEADER_.size and bytes[..AR-HEADER_.size] == AR-HEADER_.to-byte-array

/**
Expand Down
6 changes: 3 additions & 3 deletions tests/ar_test.toit
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ write-ar file-mapping/Map --add-with-ar-file/bool=false:
run-test file-mapping/Map tmp-dir [generate-ar]:
ba := generate-ar.call tmp-dir file-mapping

expect (has-valid-header ba)
expect (has-valid-ar-header ba)

seen := {}
count := 0
Expand Down Expand Up @@ -146,5 +146,5 @@ main:
run-tests: |tmp-dir file-mapping| write-ar file-mapping
run-tests: |tmp-dir file-mapping| write-ar file-mapping --add-with-ar-file

expect-not (has-valid-header "not an ar file".to-byte-array)
expect-not (has-valid-header #[])
expect-not (has-valid-ar-header "not an ar file".to-byte-array)
expect-not (has-valid-ar-header #[])

0 comments on commit 66f0359

Please sign in to comment.