schema BUGFIX correct yang-version value for 1.0
Instead of "1.0", the correct value is just "1".
diff --git a/tests/utests/schema/test_parser_yang.c b/tests/utests/schema/test_parser_yang.c
index c8b3511..02fa063 100644
--- a/tests/utests/schema/test_parser_yang.c
+++ b/tests/utests/schema/test_parser_yang.c
@@ -1060,11 +1060,11 @@
assert_int_equal(LY_EVALID, parse_module(&ctx, &in, mod));
logbuf_assert("Invalid value \"10\" of \"yang-version\". Line number 3.");
mod = mod_renew(&ctx);
- in.current = SCHEMA_BEGINNING2 "yang-version 1.0;yang-version 1.1;}";
+ in.current = SCHEMA_BEGINNING2 "yang-version 1;yang-version 1.1;}";
assert_int_equal(LY_EVALID, parse_module(&ctx, &in, mod));
logbuf_assert("Duplicate keyword \"yang-version\". Line number 3.");
mod = mod_renew(&ctx);
- in.current = SCHEMA_BEGINNING2 "yang-version 1.0;}";
+ in.current = SCHEMA_BEGINNING2 "yang-version 1;}";
assert_int_equal(LY_SUCCESS, parse_module(&ctx, &in, mod));
assert_int_equal(1, mod->mod->version);
mod = mod_renew(&ctx);
diff --git a/tests/utests/schema/test_parser_yin.c b/tests/utests/schema/test_parser_yin.c
index 93d0d7c..e5fa612 100644
--- a/tests/utests/schema/test_parser_yin.c
+++ b/tests/utests/schema/test_parser_yin.c
@@ -1226,7 +1226,7 @@
struct lysp_ext_instance *exts = NULL;
/* valid values */
- data = ELEMENT_WRAPPER_START "<yang-version value=\"1.0\" />" ELEMENT_WRAPPER_END;
+ data = ELEMENT_WRAPPER_START "<yang-version value=\"1\" />" ELEMENT_WRAPPER_END;
assert_int_equal(test_element_helper(st, data, &version, NULL, NULL), LY_SUCCESS);
assert_true(version & LYS_VERSION_1_0);
assert_int_equal(st->yin_ctx->mod_version, LYS_VERSION_1_0);
@@ -1243,7 +1243,7 @@
/* invalid value */
data = ELEMENT_WRAPPER_START "<yang-version value=\"version\" />" ELEMENT_WRAPPER_END;
assert_int_equal(test_element_helper(st, data, &version, NULL, NULL), LY_EVALID);
- logbuf_assert("Invalid value \"version\" of \"value\" attribute in \"yang-version\" element. Valid values are \"1.0\" and \"1.1\". Line number 1.");
+ logbuf_assert("Invalid value \"version\" of \"value\" attribute in \"yang-version\" element. Valid values are \"1\" and \"1.1\". Line number 1.");
st->finished_correctly = true;
}
@@ -4087,7 +4087,7 @@
lyxml_ctx_free(st->yin_ctx->xmlctx);
lysp_submod = calloc(1, sizeof *lysp_submod);
data = "<submodule xmlns=\"urn:ietf:params:xml:ns:yang:yin:1\" name=\"submod\">"
- "<yang-version value=\"1.0\"/>"
+ "<yang-version value=\"1\"/>"
"<belongs-to module=\"mod-name\"><prefix value=\"pref\"/></belongs-to>"
"</submodule>";
assert_int_equal(ly_in_new_memory(data, &st->in), LY_SUCCESS);
@@ -4103,7 +4103,7 @@
lyxml_ctx_free(st->yin_ctx->xmlctx);
lysp_submod = calloc(1, sizeof *lysp_submod);
data = "<submodule xmlns=\"urn:ietf:params:xml:ns:yang:yin:1\" name=\"submod\">"
- "<yang-version value=\"1.0\"/>"
+ "<yang-version value=\"1\"/>"
"<reference><text>ref</text></reference>\n"
"<belongs-to module=\"mod-name\"><prefix value=\"pref\"/></belongs-to>"
"</submodule>";
@@ -4165,7 +4165,7 @@
"xmlns:foo=\"urn:example:foo\""
"xmlns:myext=\"urn:example:extensions\">\n"
- "<yang-version value=\"1.0\"/>\n"
+ "<yang-version value=\"1\"/>\n"
"<namespace uri=\"urn:example:foo\"/>\n"
"<prefix value=\"foo\"/>\n"
@@ -4199,7 +4199,7 @@
mod = calloc(1, sizeof *mod);
mod->ctx = st->ctx;
data = "<module name=\"example-foo\" xmlns=\"urn:ietf:params:xml:ns:yang:yin:1\">\n"
- "<yang-version value=\"1.0\"/>\n"
+ "<yang-version value=\"1\"/>\n"
"<namespace uri=\"urn:example:foo\"/>\n"
"<prefix value=\"foo\"/>\n"
"</module>\n";
@@ -4226,7 +4226,7 @@
mod = calloc(1, sizeof *mod);
mod->ctx = st->ctx;
data = "<module name=\"example-foo\" xmlns=\"urn:ietf:params:xml:ns:yang:yin:1\">\n"
- "<yang-version value=\"1.0\"/>\n"
+ "<yang-version value=\"1\"/>\n"
"<namespace uri=\"urn:example:foo\"/>\n"
"<prefix value=\"foo\"/>\n"
"</module>"
@@ -4257,7 +4257,7 @@
"<submodule name=\"asub\""
"xmlns=\"urn:ietf:params:xml:ns:yang:yin:1\""
"xmlns:a=\"urn:a\">"
- "<yang-version value=\"1.0\"/>\n"
+ "<yang-version value=\"1\"/>\n"
"<belongs-to module=\"a\">"
"<prefix value=\"a_pref\"/>"
"</belongs-to>"
@@ -4287,7 +4287,7 @@
data = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
"<submodule name=\"asub\" xmlns=\"urn:ietf:params:xml:ns:yang:yin:1\">"
- "<yang-version value=\"1.0\"/>\n"
+ "<yang-version value=\"1\"/>\n"
"<belongs-to module=\"a\">"
"<prefix value=\"a_pref\"/>"
"</belongs-to>"
@@ -4314,13 +4314,13 @@
data = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
"<submodule name=\"asub\" xmlns=\"urn:ietf:params:xml:ns:yang:yin:1\">"
- "<yang-version value=\"1.0\"/>\n"
+ "<yang-version value=\"1\"/>\n"
"<belongs-to module=\"a\">"
"<prefix value=\"a_pref\"/>"
"</belongs-to>"
"</submodule>"
"<submodule name=\"asub\" xmlns=\"urn:ietf:params:xml:ns:yang:yin:1\">"
- "<yang-version value=\"1.0\"/>\n"
+ "<yang-version value=\"1\"/>\n"
"<belongs-to module=\"a\">"
"<prefix value=\"a_pref\"/>"
"</belongs-to>"