diff --git a/README.md b/README.md index 35ccac4..3eddba2 100644 --- a/README.md +++ b/README.md @@ -88,7 +88,7 @@ flowchart TB PureXML is a working, dependency-free XML library today: parse, emit, validate, query, and stream documents on macOS, Linux, Windows, and WASM. The test suite -currently runs **767 tests in 117 suites** (`swift test`). +currently runs **768 tests in 117 suites** (`swift test`). ### Shipped (libxml2-aligned surface) diff --git a/Tests/ValidationFrameworkTests.swift b/Tests/ValidationFrameworkTests.swift index 56485d8..f164402 100644 --- a/Tests/ValidationFrameworkTests.swift +++ b/Tests/ValidationFrameworkTests.swift @@ -63,6 +63,16 @@ struct ValidationFrameworkTests { #expect((fail || fail)(context(sample)).count == 2) } + @Test("The Bool forms of && and || combine predicates") + func test_andOrBool() { + let yes: (Context) -> Bool = { _ in true } + let nope: (Context) -> Bool = { _ in false } + #expect((yes && yes)(context(sample))) + #expect(!(yes && nope)(context(sample))) + #expect((yes || nope)(context(sample))) + #expect(!(nope || nope)(context(sample))) + } + @Test("take digs to a value and runs logic") func test_take() { let check: (Context) -> Bool = take(\Element.attributes) { $0.count == 1 }