mirror of
https://github.com/horizon-rust/horizon.git
synced 2026-11-07 11:06:11 -10:00
Recipe book parity cases: empty batches, forgotten highlights, every book's settings
This commit is contained in:
1 parent
8d93d68f1d
commit
b506983946
1 file changed
+10
@@ -66,6 +66,16 @@ def main():
|
||||
op['drop'] = rng.choice(['recipes', 'toBeDisplayed'])
|
||||
ops.append(op)
|
||||
cases.append({'ops': ops})
|
||||
# An empty batch, a recipe the book never had, a highlight taken back
|
||||
# twice, and the settings of all four book types carried through a save
|
||||
# and a load: states the random batches leave out.
|
||||
cases.append({'ops': [{'op': 'give', 'ids': []}, {'op': 'take', 'ids': []}, {'op': 'save'}, {'op': 'load'}]})
|
||||
cases.append({'ops': [{'op': 'take', 'ids': ids[:4]}, {'op': 'seen', 'id': ids[0]},
|
||||
{'op': 'seen', 'id': ids[0]}, {'op': 'save'}, {'op': 'load'}, {'op': 'seen', 'id': ids[1]}]})
|
||||
cases.append({'ops': [{'op': 'give', 'ids': ids[:6]},
|
||||
*[{'op': 'set', 'type': t, 'open': o, 'filtering': f}
|
||||
for t in TYPES for o, f in ((True, False), (False, True))],
|
||||
{'op': 'save'}, {'op': 'load'}, {'op': 'save'}, {'op': 'load', 'drop': 'toBeDisplayed'}]})
|
||||
(work / 'cases.jsonl').write_text(''.join(json.dumps(c) + '\n' for c in cases))
|
||||
vanilla.run('VanillaRecipeBookOracle', work / 'cases.jsonl', work / 'native.txt')
|
||||
lib.cargo_example('horizon-client', 'recipe_book_fixture', lib.RESOURCES, work / 'cases.jsonl', work / 'rust.txt')
|
||||
|
||||
Reference in new issue
Block a user