diff --git a/README.md b/README.md index ec24ec3..a6c1ffd 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,9 @@ rules = ContainmentRules() # Check if universe can contain system can_contain = universe.can_contain(system, rules) +# -> False. Containment needs function, scale and boundary to ALL pass, and the +# function check is token overlap (Jaccard): "all" and "organized" share no +# tokens. Give both a shared token (e.g. function="organized all") to get True. # Create systems and discover interactions s1 = System(id="s1", function="process", purpose="does work", scale=1.0) diff --git a/tests/test_core.py b/tests/test_core.py index 92807de..5dc9f83 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -282,3 +282,13 @@ def test_module_entrypoint_outputs_json(self): report = json.loads(result.stdout) assert report["status"] == "runnable" + + +def test_readme_quick_start_containment_results_match_the_documented_comment(): + """README Quick Start documents False for its pair and True with a shared token.""" + rules = ContainmentRules() + universe = Container(id="universe", function="all", purpose="contains everything") + system = Container(id="system", function="organized", purpose="organized function") + assert universe.can_contain(system, rules) is False + shared = Container(id="universe", function="organized all", purpose="contains everything") + assert shared.can_contain(system, rules) is True