leptris 1.9.432.2-aarch64-linux → 1.9.434.0-aarch64-linux
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Rakefile +1 -1
- data/lib/leptris/version.rb +1 -1
- data/lib/libleptris.so +0 -0
- data/vendor-src/README.md +1 -1
- data/vendor-src/libleptris/CHANGELOG.md +34 -0
- data/vendor-src/libleptris/CMakeLists.txt +1 -1
- data/vendor-src/libleptris/src/include/leptris.h +2 -2
- data/vendor-src/libleptris/src/leptris/core.c +4 -4
- data/vendor-src/libleptris/src/leptris/rng/parse.c +9 -0
- data/vendor-src/libleptris/src/leptris/rng/validate.c +9 -8
- data/vendor-src/libleptris/test/CMakeLists.txt +5 -0
- data/vendor-src/libleptris/test/abi/test_version_lockstep.cpp +87 -0
- data/vendor-src/libleptris/test/rng/test_rng.cpp +181 -6
- data/vendor-src/libleptris/vcpkg.json +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2aa62bee9e985f6d57d33e9ac09ee155528d77eee7becb412fd81be48d5fed80
|
|
4
|
+
data.tar.gz: d4dcd23d9c1a10f76016aabb0e99422cbdec861862ae32901bf3416ae685ad8d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 983b4673b7cb1f1346ccb73df3b12381af654ab01d0b7f2e28a88faf1498e3a69ab81a0762e7ef75815124c5d1c532e1e5bbd8bbc74bcc023e2cafbaba24c497
|
|
7
|
+
data.tar.gz: eaebc503369f0d39d613ca3799b82a45bf87709f1b36c1e9a7c29e9ad1ad6e237b0b5e869277fadd531b4a5a62766fb2929a175d7f5938cd418990b1c686dc9f
|
data/Rakefile
CHANGED
|
@@ -8,7 +8,7 @@ RSpec::Core::RakeTask.new(:spec)
|
|
|
8
8
|
# Pin for `rake compile` and the platform-gem builds. Keep in lockstep
|
|
9
9
|
# with .github/workflows/build.yml (which calls `rake compile`) and the
|
|
10
10
|
# CHANGELOG when libleptris releases.
|
|
11
|
-
LIBLEPTRIS_VERSION = "1.9.
|
|
11
|
+
LIBLEPTRIS_VERSION = "1.9.434"
|
|
12
12
|
|
|
13
13
|
# THE SSOT for the per-minor native bundle list (ruby#645): one line,
|
|
14
14
|
# space-separated, consumed by the Rakefile, the per-minor builder's
|
data/lib/leptris/version.rb
CHANGED
data/lib/libleptris.so
CHANGED
|
Binary file
|
data/vendor-src/README.md
CHANGED
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [1.9.434] - 2026-11-22
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- rng: element name classes inherit the grammar ns (RNG 4.1) —
|
|
8
|
+
namespace-less documents no longer validate as conformant against
|
|
9
|
+
namespaced schemas, and the root name-class failure short-circuits
|
|
10
|
+
at one diagnostic exactly as Jing reports. Closes #2117: the
|
|
11
|
+
OpenMath 2.0 standard's own namespace-less examples now match Jing
|
|
12
|
+
and the plurimath corpus verdict-for-verdict (l3993 invalid with
|
|
13
|
+
one error instead of accepted; l2430 one error instead of a
|
|
14
|
+
double report) — all 4 parity rows on plurimath/openmath#25.
|
|
15
|
+
Attribute name classes keep the no-namespace default; `<anyName/>`
|
|
16
|
+
stays unconstrained (#2122).
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
## [1.9.433] - 2026-11-22
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
|
|
24
|
+
- release: all four version surfaces move together — the bump script
|
|
25
|
+
updated four files but the release workflow's commit step staged
|
|
26
|
+
three, so `src/include/leptris.h` was silently discarded on every
|
|
27
|
+
train since 1.9.145 (287 releases shipped header macros frozen at
|
|
28
|
+
1.9.145; the non-CMake fallback reported 0.26.8-era strings). The
|
|
29
|
+
commit step now stages every file the script touches, the script
|
|
30
|
+
also syncs the core.c fallback block, and
|
|
31
|
+
`test/abi/test_version_lockstep` pins CMakeLists == leptris.h ==
|
|
32
|
+
core.c == `leptris_version()` so any future drift fails CI with
|
|
33
|
+
the drifted surface named (#2118).
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
3
37
|
## [1.9.432] - 2026-11-21
|
|
4
38
|
|
|
5
39
|
### Fixed
|
|
@@ -4207,8 +4207,8 @@ LEPTRIS_API const char* leptris_xinclude_get_encoding(LeptrisElement include_ele
|
|
|
4207
4207
|
* CI's export-surface gate diffs the header against the binary. */
|
|
4208
4208
|
#define LIBLEPTRIS_VERSION_MAJOR 1
|
|
4209
4209
|
#define LIBLEPTRIS_VERSION_MINOR 9
|
|
4210
|
-
#define LIBLEPTRIS_VERSION_PATCH
|
|
4211
|
-
#define LIBLEPTRIS_VERSION_STRING "1.9.
|
|
4210
|
+
#define LIBLEPTRIS_VERSION_PATCH 434
|
|
4211
|
+
#define LIBLEPTRIS_VERSION_STRING "1.9.434"
|
|
4212
4212
|
|
|
4213
4213
|
/**
|
|
4214
4214
|
* Get libleptris version string
|
|
@@ -21,16 +21,16 @@
|
|
|
21
21
|
* reaches here via target_compile_definitions in src/CMakeLists.txt.
|
|
22
22
|
* Fallback keeps hand-built compilers honest. */
|
|
23
23
|
#ifndef LEPTRIS_VERSION
|
|
24
|
-
#define LEPTRIS_VERSION "
|
|
24
|
+
#define LEPTRIS_VERSION "1.9.434"
|
|
25
25
|
#endif
|
|
26
26
|
#ifndef LEPTRIS_VERSION_MAJOR
|
|
27
|
-
#define LEPTRIS_VERSION_MAJOR
|
|
27
|
+
#define LEPTRIS_VERSION_MAJOR 1
|
|
28
28
|
#endif
|
|
29
29
|
#ifndef LEPTRIS_VERSION_MINOR
|
|
30
|
-
#define LEPTRIS_VERSION_MINOR
|
|
30
|
+
#define LEPTRIS_VERSION_MINOR 9
|
|
31
31
|
#endif
|
|
32
32
|
#ifndef LEPTRIS_VERSION_PATCH
|
|
33
|
-
#define LEPTRIS_VERSION_PATCH
|
|
33
|
+
#define LEPTRIS_VERSION_PATCH 434
|
|
34
34
|
#endif
|
|
35
35
|
|
|
36
36
|
/* Thread-local allocator hooks (TODO 27/74).
|
|
@@ -121,6 +121,15 @@ static RngPattern* parse_pattern(RngGrammar* g, LeptrisElement e,
|
|
|
121
121
|
return NULL;
|
|
122
122
|
}
|
|
123
123
|
p->any_name = 1;
|
|
124
|
+
} else if (!p->ns) {
|
|
125
|
+
/* RNG 4.1: a named element name class without its own ns
|
|
126
|
+
* inherits the nearest ancestor grammar's ns; with none
|
|
127
|
+
* anywhere, the namespace is none — it matches only
|
|
128
|
+
* namespace-less instances. Leaving it unresolved made
|
|
129
|
+
* namespace-less documents validate against namespaced
|
|
130
|
+
* schemas (#2117: the OpenMath standard's own examples). */
|
|
131
|
+
p->ns = g->default_ns ? leptris_strdup(g->default_ns)
|
|
132
|
+
: leptris_strdup("");
|
|
124
133
|
}
|
|
125
134
|
} else if (is_rng(e, "attribute")) {
|
|
126
135
|
p = pat_new(RNG_ATTRIBUTE);
|
|
@@ -204,19 +204,20 @@ static int all_text_ws(LeptrisElement e) {
|
|
|
204
204
|
}
|
|
205
205
|
|
|
206
206
|
static int names_match(const RngPattern* p, LeptrisElement e) {
|
|
207
|
+
/* A namespace-less instance element sits in NO namespace — "".
|
|
208
|
+
* The NULL check used to reject such elements outright, which is
|
|
209
|
+
* only right when the name class names a namespace; for the
|
|
210
|
+
* resolved-empty name class (grammar without ns, #2117) it must
|
|
211
|
+
* match. */
|
|
212
|
+
const char* uri = leptris_element_get_namespace_uri(e);
|
|
213
|
+
if (!uri) uri = "";
|
|
207
214
|
if (p->any_name) {
|
|
208
|
-
if (p->ns)
|
|
209
|
-
const char* uri = leptris_element_get_namespace_uri(e);
|
|
210
|
-
if (!uri || strcmp(p->ns, uri) != 0) return 0;
|
|
211
|
-
}
|
|
215
|
+
if (p->ns && strcmp(p->ns, uri) != 0) return 0;
|
|
212
216
|
return 1;
|
|
213
217
|
}
|
|
214
218
|
const char* n = leptris_element_name(e);
|
|
215
219
|
if (!n || strcmp(p->name, n) != 0) return 0;
|
|
216
|
-
if (p->ns)
|
|
217
|
-
const char* uri = leptris_element_get_namespace_uri(e);
|
|
218
|
-
if (!uri || strcmp(p->ns, uri) != 0) return 0;
|
|
219
|
-
}
|
|
220
|
+
if (p->ns && strcmp(p->ns, uri) != 0) return 0;
|
|
220
221
|
return 1;
|
|
221
222
|
}
|
|
222
223
|
|
|
@@ -243,6 +243,11 @@ leptris_add_test(test_recorder sax/test_recorder.cpp)
|
|
|
243
243
|
leptris_add_test(test_iterparse sax/test_iterparse.cpp)
|
|
244
244
|
leptris_add_test(test_streaming sax/test_streaming.cpp)
|
|
245
245
|
leptris_add_test(test_abi abi/test_header_hygiene.cpp)
|
|
246
|
+
leptris_add_test(test_version_lockstep abi/test_version_lockstep.cpp)
|
|
247
|
+
# The lockstep spec reads the repo's own version surfaces (CMakeLists,
|
|
248
|
+
# leptris.h, core.c) — hand it the repo root.
|
|
249
|
+
target_compile_definitions(test_version_lockstep PRIVATE
|
|
250
|
+
LEPTRIS_REPO_ROOT="${PROJECT_SOURCE_DIR}")
|
|
246
251
|
leptris_add_test(test_public_surface abi/test_public_surface.cpp)
|
|
247
252
|
leptris_add_test(test_serialize_abi abi/test_serialize_abi.cpp)
|
|
248
253
|
leptris_add_test(test_nokogiri_api abi/test_nokogiri_api.cpp)
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
// test/abi/test_version_lockstep.cpp — The four version surfaces agree.
|
|
2
|
+
//
|
|
3
|
+
// The engine's version lives in four hand-reachable places:
|
|
4
|
+
// 1. CMakeLists.txt project(leptris VERSION x.y.z)
|
|
5
|
+
// 2. src/include/leptris.h LIBLEPTRIS_VERSION_{MAJOR,MINOR,PATCH,STRING}
|
|
6
|
+
// 3. src/leptris/core.c the non-CMake fallback block
|
|
7
|
+
// 4. the compiled library leptris_version()
|
|
8
|
+
//
|
|
9
|
+
// Sources 1/2/4 are what release trains and bindings consume; 3 is
|
|
10
|
+
// what hand-built compilers fall back to. The release train's bump
|
|
11
|
+
// script updates 1+2+3, and the release workflow commits them —
|
|
12
|
+
// until the commit step dropped leptris.h (287 releases shipped with
|
|
13
|
+
// the header at 1.9.145, npm 0.1.66/0.1.67 shipped wasm reporting
|
|
14
|
+
// 1.9.390). This spec fails loudly the moment any surface drifts.
|
|
15
|
+
|
|
16
|
+
#include <gtest/gtest.h>
|
|
17
|
+
|
|
18
|
+
#include <cstdio>
|
|
19
|
+
#include <cstdlib>
|
|
20
|
+
#include <fstream>
|
|
21
|
+
#include <regex>
|
|
22
|
+
#include <string>
|
|
23
|
+
|
|
24
|
+
#include "leptris.h"
|
|
25
|
+
|
|
26
|
+
#ifndef LEPTRIS_REPO_ROOT
|
|
27
|
+
#define LEPTRIS_REPO_ROOT "."
|
|
28
|
+
#endif
|
|
29
|
+
|
|
30
|
+
namespace {
|
|
31
|
+
|
|
32
|
+
std::string read_file(const std::string& path) {
|
|
33
|
+
std::ifstream in(path);
|
|
34
|
+
if (!in) return "";
|
|
35
|
+
return std::string((std::istreambuf_iterator<char>(in)),
|
|
36
|
+
std::istreambuf_iterator<char>());
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
std::string cmake_version() {
|
|
40
|
+
const std::string text = read_file(std::string(LEPTRIS_REPO_ROOT) + "/CMakeLists.txt");
|
|
41
|
+
std::smatch m;
|
|
42
|
+
const std::regex re("VERSION ([0-9]+)\\.([0-9]+)\\.([0-9]+)");
|
|
43
|
+
if (!std::regex_search(text, m, re)) return "";
|
|
44
|
+
return m[1].str() + "." + m[2].str() + "." + m[3].str();
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
std::string header_version() {
|
|
48
|
+
const std::string text =
|
|
49
|
+
read_file(std::string(LEPTRIS_REPO_ROOT) + "/src/include/leptris.h");
|
|
50
|
+
std::smatch m;
|
|
51
|
+
const std::regex re("LIBLEPTRIS_VERSION_STRING \"([^\"]+)\"");
|
|
52
|
+
if (!std::regex_search(text, m, re)) return "";
|
|
53
|
+
return m[1].str();
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
std::string core_fallback_version() {
|
|
57
|
+
const std::string text =
|
|
58
|
+
read_file(std::string(LEPTRIS_REPO_ROOT) + "/src/leptris/core.c");
|
|
59
|
+
std::smatch m;
|
|
60
|
+
const std::regex re("#define LEPTRIS_VERSION \"([^\"]+)\"");
|
|
61
|
+
if (!std::regex_search(text, m, re)) return "";
|
|
62
|
+
return m[1].str();
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
TEST(VersionLockstep, AllFourSurfacesAgree) {
|
|
66
|
+
const std::string cmake = cmake_version();
|
|
67
|
+
const std::string header = header_version();
|
|
68
|
+
const std::string fallback = core_fallback_version();
|
|
69
|
+
const std::string runtime = leptris_version();
|
|
70
|
+
|
|
71
|
+
ASSERT_FALSE(cmake.empty()) << "CMakeLists.txt lost project(... VERSION x.y.z)";
|
|
72
|
+
ASSERT_FALSE(header.empty()) << "leptris.h lost LIBLEPTRIS_VERSION_STRING";
|
|
73
|
+
ASSERT_FALSE(fallback.empty()) << "core.c lost the LEPTRIS_VERSION fallback";
|
|
74
|
+
ASSERT_FALSE(runtime.empty()) << "leptris_version() returned empty";
|
|
75
|
+
|
|
76
|
+
EXPECT_EQ(header, cmake)
|
|
77
|
+
<< "leptris.h macros (" << header << ") drifted from CMakeLists.txt (" << cmake
|
|
78
|
+
<< ") — the release train's commit step must carry src/include/leptris.h";
|
|
79
|
+
EXPECT_EQ(fallback, cmake)
|
|
80
|
+
<< "core.c's non-CMake fallback (" << fallback << ") drifted from CMakeLists.txt ("
|
|
81
|
+
<< cmake << ") — bump-version.sh must sync the fallback block";
|
|
82
|
+
EXPECT_EQ(runtime, cmake)
|
|
83
|
+
<< "the compiled leptris_version() (" << runtime << ") disagrees with CMakeLists.txt ("
|
|
84
|
+
<< cmake << ") — the build injected a different version than the project declares";
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
} // namespace
|
|
@@ -189,14 +189,17 @@ TEST(RngParse, SkipsForeignNamespaceAnnotations) {
|
|
|
189
189
|
|
|
190
190
|
TEST(RngParse, AnyNameNameClassMatchesAnyElement) {
|
|
191
191
|
/* <element><anyName/> is the wildcard name class (RELAX NG
|
|
192
|
-
* 4.14): biblio.rng's recursive AnyElement define.
|
|
192
|
+
* 4.14): biblio.rng's recursive AnyElement define. The grammar
|
|
193
|
+
* carries ns — the root's name class inherits it (#2117) while
|
|
194
|
+
* anyName stays unconstrained, matching the ns'd children. */
|
|
193
195
|
LeptrisStatus st = LEPTRIS_OK;
|
|
194
|
-
const char schema[] =
|
|
196
|
+
const char schema[] =
|
|
197
|
+
"<grammar xmlns='" RNGNS "' ns='urn:t'>"
|
|
195
198
|
"<start><element name='r'>"
|
|
196
199
|
"<oneOrMore><element><anyName/>"
|
|
197
200
|
"<attribute><anyName/></attribute><text/>"
|
|
198
201
|
"</element></oneOrMore>"
|
|
199
|
-
"</element></start>"
|
|
202
|
+
"</element></start></grammar>";
|
|
200
203
|
LeptrisRelaxNG rng = leptris_rng_parse(schema, sizeof(schema) - 1, &st);
|
|
201
204
|
ASSERT_EQ(st, LEPTRIS_OK) << "anyName must parse";
|
|
202
205
|
ASSERT_NE(rng, nullptr);
|
|
@@ -269,7 +272,11 @@ TEST(RngErrors, AccumulatesAndExposesPerError) {
|
|
|
269
272
|
LeptrisStatus st = LEPTRIS_OK; LeptrisRelaxNG schema = leptris_rng_parse(
|
|
270
273
|
sch, std::strlen(sch), &st);
|
|
271
274
|
ASSERT_NE(schema, nullptr);
|
|
272
|
-
|
|
275
|
+
/* Namespace-less instance: with no grammar ns anywhere, the root's
|
|
276
|
+
* name class is the no-namespace, so an xmlns'd root would
|
|
277
|
+
* short-circuit at one root error (Jing-verified). The ns-less
|
|
278
|
+
* instance reaches the content walk — the multi-error subject. */
|
|
279
|
+
const char* ins = "<r><x/><y/></r>";
|
|
273
280
|
LeptrisDocument doc = leptris_parse_string(
|
|
274
281
|
ins, std::strlen(ins), NULL);
|
|
275
282
|
int valid = leptris_rng_validate(schema, doc);
|
|
@@ -308,7 +315,8 @@ TEST(RngErrors, ErrorReportReturnsTheWholeStructuredList) {
|
|
|
308
315
|
LeptrisStatus st = LEPTRIS_OK;
|
|
309
316
|
LeptrisRelaxNG schema = leptris_rng_parse(sch, std::strlen(sch), &st);
|
|
310
317
|
ASSERT_NE(schema, nullptr);
|
|
311
|
-
|
|
318
|
+
/* Namespace-less instance (see AccumulatesAndExposesPerError). */
|
|
319
|
+
const char* ins = "<r><x/><y/></r>";
|
|
312
320
|
LeptrisDocument doc = leptris_parse_string(ins, std::strlen(ins), NULL);
|
|
313
321
|
ASSERT_EQ(leptris_rng_validate(schema, doc), 0);
|
|
314
322
|
|
|
@@ -325,7 +333,7 @@ TEST(RngErrors, ErrorReportReturnsTheWholeStructuredList) {
|
|
|
325
333
|
EXPECT_NE(strstr(report[2].message, "incomplete"), nullptr);
|
|
326
334
|
|
|
327
335
|
/* A valid document reports an empty report (count 0). */
|
|
328
|
-
const char* ok_ins = "<r
|
|
336
|
+
const char* ok_ins = "<r><a/></r>";
|
|
329
337
|
LeptrisDocument ok = leptris_parse_string(ok_ins, strlen(ok_ins), NULL);
|
|
330
338
|
ASSERT_EQ(leptris_rng_validate(schema, ok), 1);
|
|
331
339
|
const LeptrisRngErrorRecord* empty = (const LeptrisRngErrorRecord*)1;
|
|
@@ -2673,3 +2681,170 @@ TEST(Rng2093InterleaveIntoGroup, DiagnosisKeepsTheGroupBranchTail) {
|
|
|
2673
2681
|
<< msgs;
|
|
2674
2682
|
leptris_rng_free(rng);
|
|
2675
2683
|
}
|
|
2684
|
+
|
|
2685
|
+
/* ---- #2117: RelaxNG name-class namespaces ----
|
|
2686
|
+
*
|
|
2687
|
+
* The grammar-level ns attribute must reach ELEMENT name-classes
|
|
2688
|
+
* (RNG 4.1: a name class without its own ns inherits the nearest
|
|
2689
|
+
* ancestor grammar's ns; ATTRIBUTE name-classes default to NO
|
|
2690
|
+
* namespace). The engine skipped the ns comparison entirely, so
|
|
2691
|
+
* ns-less instances matched namespaced schemas: the OpenMath 2.0
|
|
2692
|
+
* standard's own namespace-less examples validated as conformant
|
|
2693
|
+
* that Jing rejects with exactly one root error (plurimath/
|
|
2694
|
+
* openmath#25: 4/1843 corpus rows). */
|
|
2695
|
+
|
|
2696
|
+
TEST(Rng2117NameClassNsInheritance, GrammarNsReachesElementNameClass) {
|
|
2697
|
+
/* openmath2.rng's shape: <grammar ns="http://om"> + <element
|
|
2698
|
+
* name="OMOBJ"> with no ns attribute of its own. */
|
|
2699
|
+
const char* schema =
|
|
2700
|
+
"<grammar xmlns=\"http://relaxng.org/ns/structure/1.0\""
|
|
2701
|
+
" ns=\"http://om\">"
|
|
2702
|
+
"<start><element name=\"OMOBJ\">"
|
|
2703
|
+
"<optional><attribute name=\"version\"><data type=\"string\"/></attribute></optional>"
|
|
2704
|
+
"<element name=\"OMS\">"
|
|
2705
|
+
"<attribute name=\"cd\"><data type=\"string\"/></attribute>"
|
|
2706
|
+
"<attribute name=\"name\"><data type=\"string\"/></attribute>"
|
|
2707
|
+
"</element>"
|
|
2708
|
+
"</element></start>"
|
|
2709
|
+
"</grammar>";
|
|
2710
|
+
LeptrisRelaxNG rng = leptris_rng_parse(schema, strlen(schema), nullptr);
|
|
2711
|
+
ASSERT_NE(rng, nullptr);
|
|
2712
|
+
struct { const char* doc; int want; const char* why; } cases[] = {
|
|
2713
|
+
{"<OMOBJ xmlns=\"http://om\" version=\"2.0\">"
|
|
2714
|
+
"<OMS cd=\"a\" name=\"b\"/></OMOBJ>", 1,
|
|
2715
|
+
"declared in the grammar's namespace: valid"},
|
|
2716
|
+
{"<OMOBJ version=\"2.0\"><OMS cd=\"a\" name=\"b\"/></OMOBJ>", 0,
|
|
2717
|
+
"namespace-less OMOBJ is NOT the schema's OMOBJ (Jing: 1 error)"},
|
|
2718
|
+
{"<OMOBJ xmlns=\"http://other\"><OMS cd=\"a\" name=\"b\"/></OMOBJ>", 0,
|
|
2719
|
+
"a foreign namespace is not the schema's either"},
|
|
2720
|
+
};
|
|
2721
|
+
for (auto& c : cases) {
|
|
2722
|
+
LeptrisStatus st = LEPTRIS_OK;
|
|
2723
|
+
LeptrisDocument d = leptris_parse_string(c.doc, strlen(c.doc), &st);
|
|
2724
|
+
ASSERT_NE(d, nullptr) << c.doc;
|
|
2725
|
+
std::string msgs;
|
|
2726
|
+
EXPECT_EQ(rng2093_check(rng, c.doc, &msgs), c.want)
|
|
2727
|
+
<< c.why << " — " << msgs;
|
|
2728
|
+
leptris_document_free(d);
|
|
2729
|
+
}
|
|
2730
|
+
leptris_rng_free(rng);
|
|
2731
|
+
}
|
|
2732
|
+
|
|
2733
|
+
TEST(Rng2117NameClassNsInheritance, NsLessRootFailsExactlyOnce) {
|
|
2734
|
+
/* The #2117 l2430 shape: a namespace-less document whose CONTENT
|
|
2735
|
+
* is also invalid (OMR carries xref where href is required). Jing
|
|
2736
|
+
* reports ONE error — the root's name-class failure — and does
|
|
2737
|
+
* not descend. The engine reported the two content defects. */
|
|
2738
|
+
const char* schema =
|
|
2739
|
+
"<grammar xmlns=\"http://relaxng.org/ns/structure/1.0\""
|
|
2740
|
+
" ns=\"http://om\">"
|
|
2741
|
+
"<start><element name=\"OMOBJ\">"
|
|
2742
|
+
"<element name=\"OMA\">"
|
|
2743
|
+
"<element name=\"OMS\">"
|
|
2744
|
+
"<attribute name=\"cd\"><data type=\"string\"/></attribute>"
|
|
2745
|
+
"<attribute name=\"name\"><data type=\"string\"/></attribute>"
|
|
2746
|
+
"</element>"
|
|
2747
|
+
"<element name=\"OMI\"><text/></element>"
|
|
2748
|
+
"<element name=\"OMA\">"
|
|
2749
|
+
"<element name=\"OMS\">"
|
|
2750
|
+
"<attribute name=\"cd\"><data type=\"string\"/></attribute>"
|
|
2751
|
+
"<attribute name=\"name\"><data type=\"string\"/></attribute>"
|
|
2752
|
+
"</element>"
|
|
2753
|
+
"<element name=\"OMI\"><text/></element>"
|
|
2754
|
+
"<element name=\"OMR\">"
|
|
2755
|
+
"<attribute name=\"href\"><data type=\"string\"/></attribute>"
|
|
2756
|
+
"</element>"
|
|
2757
|
+
"</element>"
|
|
2758
|
+
"</element>"
|
|
2759
|
+
"</element></start>"
|
|
2760
|
+
"</grammar>";
|
|
2761
|
+
LeptrisRelaxNG rng = leptris_rng_parse(schema, strlen(schema), nullptr);
|
|
2762
|
+
ASSERT_NE(rng, nullptr);
|
|
2763
|
+
LeptrisStatus st = LEPTRIS_OK;
|
|
2764
|
+
const char* doc =
|
|
2765
|
+
"<OMOBJ version=\"2.0\">"
|
|
2766
|
+
"<OMA><OMS cd=\"arith1\" name=\"divide\"/><OMI>1</OMI>"
|
|
2767
|
+
"<OMA><OMS cd=\"arith1\" name=\"plus\"/><OMI>1</OMI>"
|
|
2768
|
+
"<OMR xref=\"foo\"/></OMA></OMA></OMOBJ>";
|
|
2769
|
+
LeptrisDocument d = leptris_parse_string(doc, strlen(doc), &st);
|
|
2770
|
+
ASSERT_NE(d, nullptr);
|
|
2771
|
+
std::string msgs;
|
|
2772
|
+
EXPECT_EQ(rng2093_check(rng, doc, &msgs), 0) << msgs;
|
|
2773
|
+
EXPECT_EQ(leptris_rng_error_count(rng), 1u)
|
|
2774
|
+
<< "the root namespace failure short-circuits — got: " << msgs;
|
|
2775
|
+
leptris_document_free(d);
|
|
2776
|
+
/* The same document declared in the schema's namespace surfaces
|
|
2777
|
+
* the real content defect, once. */
|
|
2778
|
+
const char* ns_doc =
|
|
2779
|
+
"<OMOBJ xmlns=\"http://om\" version=\"2.0\">"
|
|
2780
|
+
"<OMA><OMS cd=\"arith1\" name=\"divide\"/><OMI>1</OMI>"
|
|
2781
|
+
"<OMA><OMS cd=\"arith1\" name=\"plus\"/><OMI>1</OMI>"
|
|
2782
|
+
"<OMR xref=\"foo\"/></OMA></OMA></OMOBJ>";
|
|
2783
|
+
d = leptris_parse_string(ns_doc, strlen(ns_doc), &st);
|
|
2784
|
+
ASSERT_NE(d, nullptr);
|
|
2785
|
+
msgs.clear();
|
|
2786
|
+
EXPECT_EQ(rng2093_check(rng, ns_doc, &msgs), 0) << msgs;
|
|
2787
|
+
leptris_document_free(d);
|
|
2788
|
+
leptris_rng_free(rng);
|
|
2789
|
+
}
|
|
2790
|
+
|
|
2791
|
+
TEST(Rng2117NameClassNsInheritance, NoGrammarNsMatchesOnlyNsLess) {
|
|
2792
|
+
/* Strictness in the other direction: a grammar without any ns
|
|
2793
|
+
* (name-class namespace = none) matches only namespace-less
|
|
2794
|
+
* elements. The engine used to match ANY namespace. */
|
|
2795
|
+
const char* schema =
|
|
2796
|
+
"<grammar xmlns=\"http://relaxng.org/ns/structure/1.0\">"
|
|
2797
|
+
"<start><element name=\"r\">"
|
|
2798
|
+
"<element name=\"s\"><empty/></element>"
|
|
2799
|
+
"</element></start>"
|
|
2800
|
+
"</grammar>";
|
|
2801
|
+
LeptrisRelaxNG rng = leptris_rng_parse(schema, strlen(schema), nullptr);
|
|
2802
|
+
ASSERT_NE(rng, nullptr);
|
|
2803
|
+
struct { const char* doc; int want; const char* why; } cases[] = {
|
|
2804
|
+
{"<r><s/></r>", 1, "both sides namespace-less"},
|
|
2805
|
+
{"<r xmlns=\"q\"><s/></r>", 0, "root in a namespace cannot match"},
|
|
2806
|
+
{"<r><s xmlns=\"q\"/></r>", 0, "child in a namespace cannot match"},
|
|
2807
|
+
};
|
|
2808
|
+
for (auto& c : cases) {
|
|
2809
|
+
LeptrisStatus st = LEPTRIS_OK;
|
|
2810
|
+
LeptrisDocument d = leptris_parse_string(c.doc, strlen(c.doc), &st);
|
|
2811
|
+
ASSERT_NE(d, nullptr) << c.doc;
|
|
2812
|
+
std::string msgs;
|
|
2813
|
+
EXPECT_EQ(rng2093_check(rng, c.doc, &msgs), c.want)
|
|
2814
|
+
<< c.why << " — " << msgs;
|
|
2815
|
+
leptris_document_free(d);
|
|
2816
|
+
}
|
|
2817
|
+
leptris_rng_free(rng);
|
|
2818
|
+
}
|
|
2819
|
+
|
|
2820
|
+
TEST(Rng2117NameClassNsInheritance, AttributeNameClassKeepsNoNsDefault) {
|
|
2821
|
+
/* Attribute name-classes do NOT inherit the grammar ns (Jing's
|
|
2822
|
+
* reading — OpenMath's unprefixed cd/name attributes validate).
|
|
2823
|
+
* A PREFIXED attribute in the schema's namespace must NOT match
|
|
2824
|
+
* a plain name class. */
|
|
2825
|
+
const char* schema =
|
|
2826
|
+
"<grammar xmlns=\"http://relaxng.org/ns/structure/1.0\""
|
|
2827
|
+
" ns=\"http://om\">"
|
|
2828
|
+
"<start><element name=\"OMS\">"
|
|
2829
|
+
"<attribute name=\"cd\"><data type=\"string\"/></attribute>"
|
|
2830
|
+
"</element></start>"
|
|
2831
|
+
"</grammar>";
|
|
2832
|
+
LeptrisRelaxNG rng = leptris_rng_parse(schema, strlen(schema), nullptr);
|
|
2833
|
+
ASSERT_NE(rng, nullptr);
|
|
2834
|
+
struct { const char* doc; int want; const char* why; } cases[] = {
|
|
2835
|
+
{"<OMS xmlns=\"http://om\" cd=\"a\"/>", 1,
|
|
2836
|
+
"unprefixed attribute (no namespace) matches the plain class"},
|
|
2837
|
+
{"<OMS xmlns=\"http://om\" xmlns:cd=\"http://om\" cd:cd=\"a\"/>", 0,
|
|
2838
|
+
"a prefixed attribute is in a namespace and cannot match"},
|
|
2839
|
+
};
|
|
2840
|
+
for (auto& c : cases) {
|
|
2841
|
+
LeptrisStatus st = LEPTRIS_OK;
|
|
2842
|
+
LeptrisDocument d = leptris_parse_string(c.doc, strlen(c.doc), &st);
|
|
2843
|
+
ASSERT_NE(d, nullptr) << c.doc;
|
|
2844
|
+
std::string msgs;
|
|
2845
|
+
EXPECT_EQ(rng2093_check(rng, c.doc, &msgs), c.want)
|
|
2846
|
+
<< c.why << " — " << msgs;
|
|
2847
|
+
leptris_document_free(d);
|
|
2848
|
+
}
|
|
2849
|
+
leptris_rng_free(rng);
|
|
2850
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg/master/scripts/vcpkg.schema.json",
|
|
3
3
|
"name": "leptris",
|
|
4
|
-
"version": "1.9.
|
|
4
|
+
"version": "1.9.434",
|
|
5
5
|
"description": "High-performance XML parser and XPath 1.0 engine in C (libleptris)",
|
|
6
6
|
"homepage": "https://github.com/leptris/leptris",
|
|
7
7
|
"license": "MIT",
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: leptris
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.9.
|
|
4
|
+
version: 1.9.434.0
|
|
5
5
|
platform: aarch64-linux
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
@@ -773,6 +773,7 @@ files:
|
|
|
773
773
|
- vendor-src/libleptris/test/abi/test_public_surface.cpp
|
|
774
774
|
- vendor-src/libleptris/test/abi/test_serialize_abi.cpp
|
|
775
775
|
- vendor-src/libleptris/test/abi/test_v0_5_14_bugs.cpp
|
|
776
|
+
- vendor-src/libleptris/test/abi/test_version_lockstep.cpp
|
|
776
777
|
- vendor-src/libleptris/test/abi/test_xpath_custom_fns.cpp
|
|
777
778
|
- vendor-src/libleptris/test/cli/test_cli.cpp
|
|
778
779
|
- vendor-src/libleptris/test/common/test_simd_spans.cpp
|