2 * Copyright (c) 2022 PANTHEON.tech, s.r.o. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.yangtools.yang.stmt;
10 import static org.junit.jupiter.api.Assertions.assertEquals;
13 import org.junit.jupiter.api.Test;
14 import org.opendaylight.yangtools.yang.common.QName;
18 void testUsesAugmentUnsupportedByFeatures() throws Exception {
19 final var module = StmtTestUtils.parseYangSource("/bugs/YT1393/foo.yang", Set.of())
20 .findModuleStatement(QName.create("foo", "foo"))
22 assertEquals(4, module.effectiveSubstatements().size());
26 void testUsesRefineUnsupportedByFeatures() throws Exception {
27 final var module = StmtTestUtils.parseYangSource("/bugs/YT1393/bar.yang", Set.of())
28 .findModuleStatement(QName.create("bar", "bar"))
30 assertEquals(5, module.effectiveSubstatements().size());
34 void testAugmentAugmentUnsupportedByFeatures() throws Exception {
35 final var module = StmtTestUtils.parseYangSource("/bugs/YT1393/baz.yang", Set.of())
36 .findModuleStatement(QName.create("baz", "baz"))
38 assertEquals(4, module.effectiveSubstatements().size());
42 void testUsesAugmentInUnsupportedByFeatures() throws Exception {
43 final var module = StmtTestUtils.parseYangSource("/bugs/YT1393/xyzzy.yang", Set.of())
44 .findModuleStatement(QName.create("xyzzy", "xyzzy"))
46 assertEquals(3, module.effectiveSubstatements().size());