mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
RUBY-23469 follow-up: use the second one of the official regexps
This commit is contained in:
@@ -145,7 +145,7 @@ public class YamlGenericValueAdapter implements JsonValueAdapter {
|
||||
private static boolean isFloat(@NotNull String s) {
|
||||
if (INFS.contains(trimSign(s)) || NANS.contains(s)) return true;
|
||||
if (hasTag(s, "float")) return true;
|
||||
return Pattern.matches("[-+]?[1-9](\\.[0-9]*[1-9])?([eE][-+]?[1-9][0-9]*)?", s);
|
||||
return Pattern.matches("[-+]?(\\.[0-9]+|[0-9]+(\\.[0-9]*)?)([eE][-+]?[0-9]+)?", s);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
+8
-1
@@ -796,10 +796,17 @@ public class YamlByJsonSchemaHighlightingTest extends JsonSchemaHighlightingTest
|
||||
public void testTravisPythonVersion() throws Exception {
|
||||
@Language("JSON") String schema = FileUtil.loadFile(new File(getTestDataPath() + "/travis.schema.json"));
|
||||
doTest(schema, "python: 3.5"); // validates as 'number'
|
||||
doTest(schema, "python: 3.50"); // validates as 'string'
|
||||
doTest(schema, "python: 3.50"); // validates as 'number'
|
||||
doTest(schema, "python: 3.50a"); // validates as 'string'
|
||||
doTest(schema, "python: <warning descr=\"Schema validation: Type is not allowed. Expected one of: array, number, string.\">null</warning>");
|
||||
}
|
||||
|
||||
public void testTravisNode() throws Exception {
|
||||
@Language("JSON") String schema = FileUtil.loadFile(new File(getTestDataPath() + "/travis.schema.json"));
|
||||
doTest(schema, "node_js: \n" +
|
||||
" - <warning descr=\"Schema validation: Type is not allowed. Expected: string.\">2.10</warning>");
|
||||
}
|
||||
|
||||
public void testExpNumberNotation() throws Exception {
|
||||
doTest("{\n" +
|
||||
" \"properties\": {\n" +
|
||||
|
||||
Reference in New Issue
Block a user