mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-06 16:19:07 -04:00
WIP: Add gir.PartialClass
This commit is contained in:
parent
632e9d7df6
commit
6fdb12fd5d
17 changed files with 231 additions and 147 deletions
|
@ -1,3 +1,3 @@
|
|||
5,32,9,Gtk.Widget does not have a property called something
|
||||
5,32,9,Class Gtk.Widget does not have a property called something
|
||||
6,43,5,Type int does not have properties
|
||||
7,17,7,Could not find object with ID 'nothing'
|
|
@ -1 +1 @@
|
|||
4,3,19,Class Gtk.Label does not contain a property called not-a-real-property
|
||||
4,3,19,Class Gtk.Label does not have a property called not-a-real-property
|
||||
|
|
5
tests/samples/template_binding.blp
Normal file
5
tests/samples/template_binding.blp
Normal file
|
@ -0,0 +1,5 @@
|
|||
using Gtk 4.0;
|
||||
|
||||
template MyWidget {
|
||||
label: bind MyWidget.other-label;
|
||||
}
|
11
tests/samples/template_binding.ui
Normal file
11
tests/samples/template_binding.ui
Normal file
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<requires lib="gtk" version="4.0"/>
|
||||
<template class="MyWidget">
|
||||
<binding name="label">
|
||||
<lookup name="other-label" type="MyWidget">
|
||||
<constant>MyWidget</constant>
|
||||
</lookup>
|
||||
</binding>
|
||||
</template>
|
||||
</interface>
|
|
@ -90,6 +90,9 @@ class TestSamples(unittest.TestCase):
|
|||
raise MultipleErrors(warnings)
|
||||
except PrintableError as e:
|
||||
def error_str(error):
|
||||
if error.start is None:
|
||||
raise Exception("Error start/end range was never set")
|
||||
|
||||
line, col = utils.idx_to_pos(error.start + 1, blueprint)
|
||||
len = error.end - error.start
|
||||
return ",".join([str(line + 1), str(col), str(len), error.message])
|
||||
|
@ -157,6 +160,7 @@ class TestSamples(unittest.TestCase):
|
|||
self.assert_sample("strings")
|
||||
self.assert_sample("style")
|
||||
self.assert_sample("template")
|
||||
self.assert_sample("template_binding")
|
||||
self.assert_sample("template_no_parent")
|
||||
self.assert_sample("translated")
|
||||
self.assert_sample("uint")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue