mirror of
https://github.com/github/codeql.git
synced 2026-05-05 05:35:13 +02:00
Swift: show QL class in generated tests on collapsed hierarchies
In those kinds of tests the results may have different final classes that are not necessarily visible (or tested) solely through the string representation. For better testing and reading of expected results, `getQlPrimaryClasses` is added in these cases.
This commit is contained in:
@@ -304,7 +304,10 @@ def generate(opts, renderer):
|
||||
total_props, partial_props = _partition(_get_all_properties_to_be_tested(c, data.classes),
|
||||
lambda p: p.is_single or p.is_predicate)
|
||||
renderer.render(ql.ClassTester(class_name=c.name,
|
||||
properties=total_props), test_dir / f"{c.name}.ql")
|
||||
properties=total_props,
|
||||
# in case of collapsed hierarchies we want to see the actual QL class in results
|
||||
show_ql_class="qltest_collapse_hierarchy" in c.pragmas),
|
||||
test_dir / f"{c.name}.ql")
|
||||
for p in partial_props:
|
||||
renderer.render(ql.PropertyTester(class_name=c.name,
|
||||
property=p), test_dir / f"{c.name}_{p.getter}.ql")
|
||||
|
||||
Reference in New Issue
Block a user