mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
tests: Add some error handling tests
This commit is contained in:
parent
241668fb94
commit
43d442a6df
11 changed files with 29 additions and 5 deletions
|
@ -73,7 +73,7 @@ class TestSamples(unittest.TestCase):
|
|||
def error_str(error):
|
||||
line, col = utils.idx_to_pos(error.start, blueprint)
|
||||
len = error.end - error.start
|
||||
return ",".join([str(line + 1), str(col), str(len), error.message])
|
||||
return ",".join([str(line + 1), str(col + 1), str(len), error.message])
|
||||
|
||||
if isinstance(e, CompileError):
|
||||
actual = error_str(e)
|
||||
|
@ -103,4 +103,8 @@ class TestSamples(unittest.TestCase):
|
|||
|
||||
|
||||
def test_sample_errors(self):
|
||||
self.assert_sample_error("conflicting_namespaces")
|
||||
self.assert_sample_error("duplicate_obj_id")
|
||||
self.assert_sample_error("two_templates")
|
||||
self.assert_sample_error("using_gtk_3")
|
||||
self.assert_sample_error("using_invalid_namespace")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue