|
Ran
|
Jobs
3
|
Files
309
|
Run time
1min
|
Badge
README BADGES
|
push
github
Preserve encoded characters in Go regexes (#855) We fix the Go renderer to preserve the literal meaning of explicitly encoded characters in constant regex strings. Previously, the renderer wrote these characters directly into the regex pattern, potentially causing encoded metacharacters to be interpreted as regex syntax. This problem affects V3.2's `matches_reference_identifier`, which contains the following ranges: ```regex \x23-\x5B\x5D-\uD7FF ``` These ranges represent characters from `#` through `[` and from `]` through U+D7FF. The old renderer produces `#-[]-` within the pattern. Go interprets `]` as the end of the character class rather than as a literal range endpoint. As a result, the regex compiles successfully but rejects valid reference identifiers. The corrected renderer preserves explicitly encoded characters using Go's supported `\x{...}` notation: ```regex \x{23}-\x{5b}\x{5d}-\x{d7ff} ``` The changes also include focused renderer tests covering encoded punctuation, bracket range endpoints, Unicode ranges, and ordinary escaped characters. The affected Go verification output for the existing AAS test metamodel has been regenerated. This PR addresses the regex-escaping problem tracked in #840. ## Runtime demonstration The metamodel explicitly documents two valid examples in [`matches_reference_identifier`]: [`matches_reference_identifier`]: https://github.com/eclipse-aascw/aas-core-meta/blob/560851dc9/aas_core_meta/v3_2.py#L11083 ```text $sm("https://example.com/sm")#idShort $sme("https://example.com/sm").someProperty#value ``` The following demonstration uses the complete regexes emitted by the old and corrected generators, without adding anchors or quantifiers. Save the program as `main.go` and execute it with: ```shell go run main.go ``` Both examples produce: ```text old=false, corrected=true, metamodel=true ``` The `metamodel` value is a hardcoded expected result, independently verifi... (continued)
1 of 1 new or added line in 1 file covered. (100.0%)
2 existing lines in 1 file now uncovered.45908 of 50905 relevant lines covered (90.18%)
2.71 hits per line
| Lines | Coverage | ∆ | File |
|---|---|---|---|
| 2 |
80.8
|
-0.8% | aas_core_codegen/golang/common.py |
| ID | Job ID | Ran | Files | Coverage | |
|---|---|---|---|---|---|
| 1 | 3.12 - 39383890623.1 | 309 |
90.18
|
GitHub Action Run | |
| 2 | 3.11 - 39383890623.2 | 309 |
90.18
|
GitHub Action Run | |
| 3 | 3.10 - 39383890623.3 | 309 |
90.18
|
GitHub Action Run |
| Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line |
|---|