Skip to content

Commit

Permalink
Logic for bumping of a crate version has been changed
Browse files Browse the repository at this point in the history
Before we updated the highest part of the version, now we will focus on the minor part of the version
  • Loading branch information
Barsik-sus committed May 13, 2024
1 parent 621003e commit 87f228e
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 87f228e

Please sign in to comment.