1 module typedef-test-restrictions-module {
3 namespace "test:typedef-test-restrictions-module";
7 "Copyright (C) 2024 Ericsson
8 Modifications Copyright (C) 2024 OpenInfra Foundation Europe";
10 revision "2020-11-11" {
11 description "initial revision";
58 // - - - - - - no changes - - - - - -
75 // - - - - - - some overrides - - - - - -
115 // - - - - - - some multi-level overrides - - - - - -
143 type this:typedef13 {
150 type this:typedef14 {
157 type this:typedef15 {
163 // - - - - - - some illegal statements for restriction - - - - - -
169 range 12..15; // Wrong, it's a string
170 enum one; // Wrong, it's a string
176 length 12..15; // Wrong, it's a numeric type
177 pattern "ab*c"; // Wrong, it's a numeric type
178 enum one; // Wrong, it's a numeric type
179 bit two; // Wrong, it's a numeric type
185 enum three { // Wrong, does not exit in original
189 value 99; // Wrong, assigning different value
196 bit seven { // Wrong, does not exit in original
200 position 99; // Wrong, assigning different position
207 // - - - - - - some legal and illegal length restrictions - - - - - -
217 length "10..20 | 50..60";
224 type this:typedef51 {
225 length 0..15; // Illegal, Original restriction is [10-20]
230 type this:typedef51 {
231 length 9..20; // Illegal, Original restriction is [10-20]
236 type this:typedef51 {
237 length 0..6; // Illegal, Original restriction is [10-20]
242 type this:typedef51 {
243 length 10..100; // Illegal, Original restriction is [10-20]
248 type this:typedef51 {
249 length "10..12 | 18..30"; // Illegal, Original restriction is [10-20]
254 type this:typedef52 {
255 length 0..15; // Illegal, Original restriction is [10-20],[50-60]
260 type this:typedef52 {
261 length 55..65; // Illegal, Original restriction is [10-20],[50-60]
266 type this:typedef52 {
267 length 15..55; // Illegal, Original restriction is [10-20],[50-60]
272 type this:typedef52 {
273 length 5..55; // Illegal, Original restriction is [10-20],[50-60]
278 type this:typedef51 {
279 length 10..20; // OK, Original restriction is [10-20]
284 type this:typedef51 {
285 length "10..10 | 20..20"; // OK, Original restriction is [10-20]
290 type this:typedef51 {
291 length 10..15; // OK, Original restriction is [10-20]
296 type this:typedef51 {
297 length 15..20; // OK, Original restriction is [10-20]
302 type this:typedef51 {
303 length "10..12 | 13..20"; // OK, Original restriction is [10-20]
308 type this:typedef52 {
309 length 10..20; // OK, Original restriction is [10-20],[50-60]
314 type this:typedef52 {
315 length 50..60; // OK, Original restriction is [10-20],[50-60]
320 type this:typedef52 {
321 length 10..15; // OK, Original restriction is [10-20],[50-60]
326 type this:typedef52 {
327 length 55..60; // OK, Original restriction is [10-20],[50-60]
332 type this:typedef52 {
333 length "10..20 | 50..50"; // OK, Original restriction is [10-20],[50-60]
338 type this:typedef52 {
339 length "10..10"; // OK, Original restriction is [10-20],[50-60]
344 type this:typedef52 {
345 length "11..13 | 15..20"; // OK, Original restriction is [10-20],[50-60]
350 type this:typedef52 {
351 length "11..13 | 15..17 | 50..52"; // OK, Original restriction is [10-20],[50-60]
357 // - - - - - - some legal and illegal range restrictions - - - - - -
367 range "-90..-40 | -10..20 | 40..70";
375 range -50..-30; // Illegal, original restriction is [-40..80]
381 range -40..90; // Illegal, original restriction is [-40..80]
387 range -50..-45; // Illegal, original restriction is [-40..80]
393 range 10..90; // Illegal, original restriction is [-40..80]
399 range 80..90; // Illegal, original restriction is [-40..80]
405 range -100..-80; // Illegal, original restriction is [-90..-40] [-10..20] [40..70]
411 range -30..-20; // Illegal, original restriction is [-90..-40] [-10..20] [40..70]
417 range 15..25; // Illegal, original restriction is [-90..-40] [-10..20] [40..70]
423 range 30..40; // Illegal, original restriction is [-90..-40] [-10..20] [40..70]
429 range -90..-40; // OK, original restriction is [-90..-40] [-10..20] [40..70]
435 range "-90..-40 | -10..20"; // OK, original restriction is [-90..-40] [-10..20] [40..70]
441 range "0..10"; // OK, original restriction is [-90..-40] [-10..20] [40..70]
447 range "3..4 | 50..60"; // OK, original restriction is [-90..-40] [-10..20] [40..70]