Skip to content

Commit

Permalink
Allow bumping straight from released version
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr authored and aviator-bot committed Nov 2, 2023
1 parent d7946b0 commit 967ae30
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 deletions.
4 changes: 0 additions & 4 deletions R/utils-parse-version.R
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,6 @@ fledge_guess_version <- function(version, which) {
} else if (which %in% c("pre-minor", "pre-major")) {
# pre-minor and pre-major

if (is.na(dev)) {
cli::cli_abort("Can't update version from not dev to {.val {which}}.")
}

if (patch >= 99) {
cli::cli_abort("Can't bump to {.val {which}} from version {.val {version}} (patch >= 99).")
}
Expand Down
10 changes: 4 additions & 6 deletions tests/testthat/_snaps/utils-parse-version.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,15 @@

Code
fledge_guess_version("1.1.1", "pre-minor")
Condition
Error in `fledge_guess_version()`:
! Can't update version from not dev to "pre-minor".
Output
[1] "1.1.99.9000"

---

Code
fledge_guess_version("1.1.1", "pre-major")
Condition
Error in `fledge_guess_version()`:
! Can't update version from not dev to "pre-major".
Output
[1] "1.99.99.9000"

---

Expand Down
6 changes: 2 additions & 4 deletions tests/testthat/test-utils-parse-version.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,11 @@ test_that("fledge_guess_version() works", {
fledge_guess_version("1.1.1", "1.0.0")
})

# FIXME: Should this really be an error?
expect_snapshot(error = TRUE, {
expect_snapshot({
fledge_guess_version("1.1.1", "pre-minor")
})

# FIXME: Should this really be an error?
expect_snapshot(error = TRUE, {
expect_snapshot({
fledge_guess_version("1.1.1", "pre-major")
})

Expand Down

0 comments on commit 967ae30

Please sign in to comment.