Skip to content

Commit

Permalink
Merge pull request #1331 from Barsik-sus/willbe-publish-bump-logic
Browse files Browse the repository at this point in the history
READY: (willbe): Logic for bumping of a crate version has been changed
  • Loading branch information
Wandalen authored May 14, 2024
2 parents 621003e + 87f228e commit b035dd0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
9 changes: 2 additions & 7 deletions module/move/willbe/src/entity/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,8 @@ mod private
pub fn bump( self ) -> Self
{
let mut ver = self.0;
if ver.major != 0
{
ver.major += 1;
ver.minor = 0;
ver.patch = 0;
}
else if ver.minor != 0
// we shouldn't change the major part of a version yet
if ver.minor != 0 || ver.major != 0
{
ver.minor += 1;
ver.patch = 0;
Expand Down
6 changes: 3 additions & 3 deletions module/move/willbe/tests/inc/entity/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ fn major_without_patches()
let new_version = version.bump();

// Assert
assert_eq!( "2.0.0", &new_version.to_string() );
assert_eq!( "1.1.0", &new_version.to_string() );
}

#[ test ]
Expand All @@ -84,7 +84,7 @@ fn major_with_minor()
let new_version = version.bump();

// Assert
assert_eq!( "2.0.0", &new_version.to_string() );
assert_eq!( "1.2.0", &new_version.to_string() );
}

#[ test ]
Expand All @@ -97,7 +97,7 @@ fn major_with_patches()
let new_version = version.bump();

// Assert
assert_eq!( "2.0.0", &new_version.to_string() );
assert_eq!( "1.2.0", &new_version.to_string() );
}

#[ test ]
Expand Down

0 comments on commit b035dd0

Please sign in to comment.