Skip to content
Permalink
Browse files

finally fix stable version bug

  • Loading branch information...
Vlad Dumitrescu authored and vladdu committed Sep 30, 2019
1 parent edd41b6 commit b69af2c1b20e39cf7bdd6458ddeab687e5991d5c
@@ -31,8 +31,6 @@ class RuntimeFinder {
result.add(rt)
}
}
println("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
println(result)
return result
}

@@ -58,7 +56,8 @@ class RuntimeFinder {
}
} catch (IOException e) {
// ignore, kerl is not available or usable
ErlLogger.warn(e)
ErlLogger.info("kerl not found")
// ErlLogger.warn(e)
}
return result.map[if(split(" ", 2).length >= 2) split(" ", 2).get(1) else null].filterNull
}
@@ -252,14 +252,15 @@ public int hashCode() {
}

public boolean isStable() {
if (update_level == null)
if (update_level == null) {
return true;
}
try {
// "rc1" is unstable, but "1" is stable
Integer.parseInt(update_level);
// "-rc1" is unstable, but ".15" is stable
// The first character is a separator
Integer.parseInt(update_level.substring(1));
return true;

} catch (NumberFormatException e) {
} catch (final NumberFormatException e) {
return false;
}
}
@@ -203,4 +203,23 @@ public void compare_11c() {
assertThat(test1.isCompatible(test2)).isEqualTo(false);
}

@Test
public void stable_1() {
final RuntimeVersion test1 = RuntimeVersion.Serializer.parse("20.1.1");
assertThat(test1.isStable());
}

@Test
public void stable_2() {
final RuntimeVersion test1 = RuntimeVersion.Serializer.parse("20.1.1-rc1");
assertThat(!test1.isStable());
}

@Test
public void stable_3() {
final RuntimeVersion test1 = RuntimeVersion.Serializer.parse("20.1.1.2");
assertThat(test1.isStable());
}


}

0 comments on commit b69af2c

Please sign in to comment.
You can’t perform that action at this time.