[gtksourceview] testsuite: include a mini def.lang for embedded resources



commit 72eba72e5abb04ddec376fbe52dba59c684e8f6c
Author: Christian Hergert <chergert redhat com>
Date:   Mon Sep 5 14:34:15 2022 -0700

    testsuite: include a mini def.lang for embedded resources
    
    That way we don't need to include paths for TOP_SRCDIR to get access to
    the def.lang styles.

 testsuite/def.lang                | 29 +++++++++++++++++++++++++++++
 testsuite/test-languagemanager.c  |  2 ++
 testsuite/testsuite.gresource.xml |  1 +
 3 files changed, 32 insertions(+)
---
diff --git a/testsuite/def.lang b/testsuite/def.lang
new file mode 100644
index 00000000..ef8b829c
--- /dev/null
+++ b/testsuite/def.lang
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ This file is part of GtkSourceView
+
+ GtkSourceView is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ GtkSourceView is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this library; if not, see <http://www.gnu.org/licenses/>.
+
+-->
+<language id="def" name="def" version="2.0" hidden="true">
+  <styles>
+    <style id="special-char" name="Special Char"/>
+    <style id="string" name="String"/>
+    <style id="number" name="Number"/>
+  </styles>
+  <definitions>
+    <context id="def"/>
+  </definitions>
+</language>
diff --git a/testsuite/test-languagemanager.c b/testsuite/test-languagemanager.c
index 1d335eea..0d7b4554 100644
--- a/testsuite/test-languagemanager.c
+++ b/testsuite/test-languagemanager.c
@@ -215,6 +215,8 @@ test_resources (void)
 
        g_assert_true (g_strv_contains (ids, "testsuite"));
        g_assert_true (g_strv_contains (ids, "testsuite-2"));
+       g_assert_true (g_strv_contains (ids, "def"));
+       g_assert_cmpint (g_strv_length ((char **)ids), ==, 3);
 
        l = gtk_source_language_manager_get_language (lm, "testsuite");
        g_assert_nonnull (l);
diff --git a/testsuite/testsuite.gresource.xml b/testsuite/testsuite.gresource.xml
index 9567a9b5..8b1e4016 100644
--- a/testsuite/testsuite.gresource.xml
+++ b/testsuite/testsuite.gresource.xml
@@ -3,5 +3,6 @@
   <gresource prefix="/language-specs">
     <file>testsuite.lang</file>
     <file>testsuite-2.lang</file>
+    <file>def.lang</file>
   </gresource>
 </gresources>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]