web_search — all cases¶
Every case file under src/clauz3/stdlib/web_search/tests/cases/,
inlined. _pass cases must prove; _fail cases must not.
See the curated walk-through for the trusted module and contract vocabulary.
src/clauz3/stdlib/web_search/tests/cases/no_query_contains_fail.py¶
# ruff: noqa: F821
from tools.web_search.trusted import contracts as srch
from tools.web_search.trusted.effects import web_search
import clauz3
@clauz3.guarantee(srch.no_query_contains("BEGIN PRIVATE KEY"))
def main() -> None:
web_search("how to use BEGIN PRIVATE KEY in openssl")
src/clauz3/stdlib/web_search/tests/cases/no_query_contains_pass.py¶
# ruff: noqa: F821
from tools.web_search.trusted import contracts as srch
from tools.web_search.trusted.effects import web_search
import clauz3
@clauz3.guarantee(srch.no_query_contains("BEGIN PRIVATE KEY"))
def main() -> None:
web_search("clauz3 docs")
src/clauz3/stdlib/web_search/tests/cases/no_searches_fail.py¶
# ruff: noqa: F821
from tools.web_search.trusted import contracts as srch
from tools.web_search.trusted.effects import web_search
import clauz3
@clauz3.guarantee(srch.no_searches())
def main() -> None:
web_search("anything")
src/clauz3/stdlib/web_search/tests/cases/no_searches_pass.py¶
# ruff: noqa: F821
from tools.web_search.trusted import contracts as srch
import clauz3
@clauz3.guarantee(srch.no_searches())
def main() -> None:
pass
src/clauz3/stdlib/web_search/tests/cases/query_length_at_most_fail.py¶
# ruff: noqa: F821
from tools.web_search.trusted import contracts as srch
from tools.web_search.trusted.effects import web_search
import clauz3
@clauz3.guarantee(srch.query_length_at_most(8))
def main() -> None:
web_search("this query is much longer than eight characters")
src/clauz3/stdlib/web_search/tests/cases/query_length_at_most_pass.py¶
# ruff: noqa: F821
from tools.web_search.trusted import contracts as srch
from tools.web_search.trusted.effects import web_search
import clauz3
@clauz3.guarantee(srch.query_length_at_most(50))
def main() -> None:
web_search("clauz3 static contracts")
src/clauz3/stdlib/web_search/tests/cases/searches_at_most_fail.py¶
# ruff: noqa: F821
from tools.web_search.trusted import contracts as srch
from tools.web_search.trusted.effects import web_search
import clauz3
@clauz3.guarantee(srch.searches_at_most(1))
def main() -> None:
web_search("foo")
web_search("bar")