1 module general-syntax-test-constraints {
3 namespace "test:general-syntax-test-constraints";
7 "Copyright (C) 2024 Ericsson
8 Modifications Copyright (C) 2024 OpenInfra Foundation Europe";
10 revision "2020-07-22" {
11 description "Initial revision";
14 // - - - - length - - - -
21 error-app-tag "some-app-tag";
22 error-message "wrong length";
35 length "min..10 | 15 | 20..max";
41 length "min .. min | max ..max"; // doesn't really make sense, but technically allowed
47 length min..max|; // Wrong
53 length |min..max; // Wrong
59 length zero..1.1; // Wrong
65 length "10..20 | 21..30"; // OK
71 length "10..20 | 20..30"; // Wrong, overlap
77 length "19..30 | 10..20"; // Wrong order
83 length "-1..-3"; // Wrong, negative.
89 length "..10..20 | 21..30"; // Wrong
95 length "10..20 | 21..30.."; // Wrong
100 // -------------- Range for integer -------------------
107 error-app-tag "some-app-tag";
108 error-message "wrong length";
169 range "10..20 | 30 .. 40";
175 range "10..20 | 25 | 30 .. 40";
181 range "min..min | max .. max";
205 range "10 .. 20 | .. 30";
211 range "10 .. | 20 .. 30";
217 range "10 .. 20 | 20 .. 30";
223 range "20 .. 10 | 25 .. 30";
229 range "30 .. 40 | 10 .. 20";
235 range "-100 .. -90 | -80 .. -70";
241 range "400 .. 410 | 610 .. 620";
247 range "10.5 .. 20.8";
258 // -------------- Range for decimal64 -------------------
277 type decimal64 { // missing fraction digits statement, should issue finding