Skip to content

Commit

Permalink
Define a first unit test for FileHelper
Browse files Browse the repository at this point in the history
  • Loading branch information
anaiberta authored Nov 26, 2024
1 parent 6c35819 commit 1e122ff
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/com/genexus/FileHelperTest.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import static org.junit.Assert.*
import org.junit.Test

class FileHelperTest {
@Test
void testStandardizeVersionForSemVer() {
FileHelper fileHelper = new FileHelper()

// Test case 1: Standard version without label
String result1 = fileHelper.standarizeVersionForSemVer("1.3.5", "88", "")
assertEquals("1.3.88", result1)

// Test case 2: Version with 'beta' label
String result2 = fileHelper.standarizeVersionForSemVer("2.1.5", "457", "beta")
assertEquals("2.1.0-beta.457", result2)

// Test case 3: Increase major version by 100 without label
String result3 = fileHelper.standarizeVersionForSemVer("1.3.5", "88", "", 100)
assertEquals("101.3.88", result3)
}
}

0 comments on commit 1e122ff

Please sign in to comment.