-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
requires
to nf-test.config
in order to specify minimal nf-tes…
…t version (#191) * Add `requires` to config to specify minimal nf-test version * Add documentation of `requires` keyword * Fix issue and add testcases * Update syntax in documentation for `requires`
- Loading branch information
Showing
6 changed files
with
115 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.askimed.nf.test.util; | ||
|
||
public class Version { | ||
|
||
public static int compare(String version1, String version2) { | ||
|
||
String parts1[] = version1.split("-", 2); | ||
String parts2[] = version2.split("-", 2); | ||
|
||
String tiles1[] = parts1[0].split("\\."); | ||
String tiles2[] = parts2[0].split("\\."); | ||
|
||
for (int i = 0; i < tiles1.length; i++) { | ||
int number1 = Integer.parseInt(tiles1[i].trim()); | ||
int number2 = Integer.parseInt(tiles2[i].trim()); | ||
|
||
if (number1 != number2) { | ||
|
||
return number1 > number2 ? 1 : -1; | ||
|
||
} | ||
|
||
} | ||
|
||
if (parts1.length > 1) { | ||
if (parts2.length > 1) { | ||
return parts1[1].compareTo(parts2[1]); | ||
} else { | ||
return -1; | ||
} | ||
} else { | ||
if (parts2.length > 1) { | ||
return 1; | ||
} | ||
} | ||
|
||
return 0; | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
config { | ||
requires ( | ||
"nf-test": "0.1.0" | ||
) | ||
configFile "" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
config { | ||
requires ( | ||
"nf-test": "100.0.0" | ||
) | ||
configFile "" | ||
} |