Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename 'has-valid-header' to 'has-valid-ar-header'. #17

Merged
merged 1 commit into from
Nov 13, 2024
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 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 #[])