context FEATURE public API for parsing schemas
diff --git a/tests/src/test_parser_yang.c b/tests/src/test_parser_yang.c
index 2d160e8..e6fec3c 100644
--- a/tests/src/test_parser_yang.c
+++ b/tests/src/test_parser_yang.c
@@ -12,8 +12,9 @@
  *     https://opensource.org/licenses/BSD-3-Clause
  */
 
-#define _BSD_SOURCE
-#define _DEFAULT_SOURCE
+#include "../../src/tree_schema.c"
+#include "../../src/parser_yang.c"
+
 #include <stdarg.h>
 #include <stddef.h>
 #include <setjmp.h>
@@ -23,8 +24,6 @@
 #include <string.h>
 
 #include "libyang.h"
-#include "../../src/parser_yang.c"
-#include "../../src/tree_schema.c"
 
 #define BUFSIZE 1024
 char logbuf[BUFSIZE] = {0};
@@ -761,6 +760,10 @@
     assert_int_equal(LY_EVALID, parse_sub_module(&ctx, &str, mod));
     logbuf_assert("Prefix \"x\" already used as module prefix. Line number 2.");
     mod = mod_renew(&ctx, mod, 0);
+    str = SCHEMA_BEGINNING "import test1 {prefix y;}import test2 {prefix y;}}";
+    assert_int_equal(LY_EVALID, parse_sub_module(&ctx, &str, mod));
+    logbuf_assert("Prefix \"y\" already used to import \"test1\" module. Line number 2.");
+    mod = mod_renew(&ctx, mod, 0);
 
     /* include */
     TEST_GENERIC("include test;}", mod->includes,