mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
WEB-11067 Karma Plugin broken because of missing intellijCli Node module
This commit is contained in:
@@ -29,13 +29,20 @@ public class SemVer {
|
||||
private final int myMajor;
|
||||
private final int myMinor;
|
||||
private final int myPatch;
|
||||
private final String myRawVersion;
|
||||
|
||||
public SemVer(int major, int minor, int patch) {
|
||||
public SemVer(@NotNull String rawVersion, int major, int minor, int patch) {
|
||||
myRawVersion = rawVersion;
|
||||
myMajor = major;
|
||||
myMinor = minor;
|
||||
myPatch = patch;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String getRawVersion() {
|
||||
return myRawVersion;
|
||||
}
|
||||
|
||||
public int getMajor() {
|
||||
return myMajor;
|
||||
}
|
||||
@@ -85,7 +92,7 @@ public class SemVer {
|
||||
}
|
||||
Integer patch = toInteger(patchStr);
|
||||
if (major != null && minor != null && patch != null) {
|
||||
return new SemVer(major, minor, patch);
|
||||
return new SemVer(text, major, minor, patch);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
package com.intellij.util.text;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
@@ -24,15 +24,17 @@ import org.junit.Test;
|
||||
public class SemVerTest {
|
||||
@Test
|
||||
public void testParsing() throws Exception {
|
||||
SemVer semVer = SemVer.parseFromText("0.9.2");
|
||||
String version = "0.9.2";
|
||||
SemVer semVer = SemVer.parseFromText(version);
|
||||
Assert.assertNotNull(semVer);
|
||||
Assert.assertEquals(new SemVer(0, 9, 2), semVer);
|
||||
Assert.assertEquals(new SemVer(version, 0, 9, 2), semVer);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testExtendedVersion() throws Exception {
|
||||
SemVer semVer = SemVer.parseFromText("0.9.2-dart");
|
||||
String version = "0.9.2-dart";
|
||||
SemVer semVer = SemVer.parseFromText(version);
|
||||
Assert.assertNotNull(semVer);
|
||||
Assert.assertEquals(new SemVer(0, 9, 2), semVer);
|
||||
Assert.assertEquals(new SemVer(version, 0, 9, 2), semVer);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user