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:
@@ -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)
|
||||
# ===========================================================================
|
||||
|
||||
Reference in New Issue
Block a user