fix: force base-10 in version_gte to prevent octal interpretation

Use 10#$var arithmetic prefix to avoid bash interpreting leading
zeros as octal (e.g., 08 or 09 would cause "value too great for
base" errors). 2 new tests (64 total).

Closes: #9

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Flo
2026-03-30 23:45:04 +02:00
parent d204ae5a9a
commit 902d1abac0
2 changed files with 20 additions and 7 deletions

View File

@@ -108,6 +108,18 @@ source_functions() {
assert_failure
}
@test "version_gte: handles leading zeros without octal error" {
source_functions
run version_gte "2.08.0" "2.07.0"
assert_success
}
@test "version_gte: leading zero comparison works correctly" {
source_functions
run version_gte "2.09.1" "2.09.0"
assert_success
}
# ===========================================================================
# Version extraction (grep-based, not sed)
# ===========================================================================