Simplify createFeaturesSet()
[yangtools.git] / parser / yang-parser-rfc7950 / src / test / java / org / opendaylight / yangtools / yang / parser / stmt / rfc7950 / Bug6886Test.java
1 /*
2  * Copyright (c) 2017 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.yangtools.yang.parser.stmt.rfc7950;
9
10 import static org.hamcrest.CoreMatchers.startsWith;
11
12 import org.junit.Test;
13 import org.opendaylight.yangtools.yang.stmt.AbstractYangTest;
14
15 public class Bug6886Test extends AbstractYangTest {
16     @Test
17     public void yang11UnquotedStrTest() {
18         assertSourceException(startsWith("YANG 1.1: unquoted string (illegalchars\"test1) contains illegal characters"),
19             "/rfc7950/bug6886/yang11/foo.yang");
20     }
21
22     @Test
23     public void yang11UnquotedStrTest2() {
24         assertSourceException(startsWith("YANG 1.1: unquoted string (illegalchars'test2) contains illegal characters"),
25             "/rfc7950/bug6886/yang11/foo2.yang");
26     }
27
28     @Test
29     public void yang11DoubleQuotedStrTest() {
30         assertSourceException(startsWith("YANG 1.1: illegal double quoted string "
31             + "(i\\\\\\\\l\\nl\\te\\\"\\galcharstest1). In double quoted string the backslash must be followed "
32             + "by one of the following character [n,t,\",\\], but was 'g'."),
33             "/rfc7950/bug6886/yang11/foo3.yang");
34     }
35
36     @Test
37     public void yang10UnquotedStrTest() {
38         assertEffectiveModel("/rfc7950/bug6886/yang10/foo.yang");
39     }
40
41     @Test
42     public void yang10UnquotedStrTest2() {
43         assertEffectiveModel("/rfc7950/bug6886/yang10/foo2.yang");
44     }
45
46     @Test
47     public void yang10DoubleQuotedStrTest() {
48         assertEffectiveModel("/rfc7950/bug6886/yang10/foo3.yang");
49     }
50 }