oughta 0.2.0.0 → 0.3.0.0
raw patch · 6 files changed
+31/−3 lines, 6 filesdep ~oughtaPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: oughta
API changes (from Hackage documentation)
Files
- CHANGELOG.md +6/−0
- README.md +2/−0
- oughta.cabal +2/−2
- src/Oughta/oughta.lua +13/−1
- test-data/fail/check-not.txt +3/−0
- test-data/pass/check-not.txt +5/−0
CHANGELOG.md view
@@ -1,3 +1,9 @@+# [0.3.0.0] -- 2025-07-06++[0.3.0.0]: https://github.com/GaloisInc/oughta/releases/tag/v0.3.0.0++- Add `check_not(s: String)`, which asserts that `s` is *not* in `text`.+ # [0.2.0.0] -- 2025-05-02 [0.2.0.0]: https://github.com/GaloisInc/oughta/releases/tag/v0.2.0.0
README.md view
@@ -197,6 +197,8 @@ - `check(s: String)`: Find `s` in `text`. Seek to after the end of `s`. Like LLVM FileCheck's `CHECK`, or [Expect's][expect] `expect`.+- `check_not(s: String)`: Assert that `s` is *not* in `text`. Do not seek. Like+ LLVM FileCheck's `CHECK-NOT`. - `checkln(s: String)`: `checkln(s)` is equivalent to `check(s .. "\n")`. - `here(s: String)`: Check that `text` beings with `s`. Seek to after the end of `s`.
oughta.cabal view
@@ -1,6 +1,6 @@ cabal-version: 3.0 name: oughta-version: 0.2.0.0+version: 0.3.0.0 author: Galois, Inc. maintainer: grease@galois.com copyright: Galois, Inc. 2025@@ -158,7 +158,7 @@ hs-source-dirs: test main-is: Test.hs build-depends:- oughta >= 0.2.0.0,+ oughta >= 0.3.0.0, build-depends: bytestring, directory,
src/Oughta/oughta.lua view
@@ -12,6 +12,19 @@ end end +function check_not(needle)+ if needle == "" then+ match(0)+ return+ end+ local start, _ = string.find(text, needle, 1, true)+ if start == nil then+ match(0)+ else+ fail()+ end+end+ function checkln(needle) check(needle .. "\n") end@@ -28,4 +41,3 @@ function hereln(needle) here(needle .. "\n") end-
+ test-data/fail/check-not.txt view
@@ -0,0 +1,3 @@+# check_not "foo"+foo+; check "❌"
+ test-data/pass/check-not.txt view
@@ -0,0 +1,5 @@+# check_not "fourth"+first+second+third+; match_on_line(1)