Skip to content

Commit

Permalink
Added WASM support
Browse files Browse the repository at this point in the history
  • Loading branch information
colemancda committed Nov 17, 2022
1 parent ca9862a commit 1c840fa
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/swift-wasm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: SwiftWASM
on: [push]
jobs:
test:
name: Test
runs-on: ubuntu-latest
container: ghcr.io/swiftwasm/carton:latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Swift Version
run: swift --version
- name: Test
run: carton test
4 changes: 4 additions & 0 deletions Tests/PredicateTests/PredicateTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@ final class PredicateTests: XCTestCase {
&& "speakers.name".all(in: ["John Apple", "Alsey Coleman Miller"])

XCTAssertEqual(try events.filter(with: predicate), events)
#if !os(WASI)
XCTAssertEqual(predicate.description, #"(((name MATCHES[c] "\w+ event" AND start < 4001-01-01 00:00:00 +0000) AND (ANY speakers.name IN {"Alsey Coleman Miller"} OR speakers.name CONTAINS "John Apple")) AND ANY speakers.name IN {"Alsey Coleman Miller", "John Apple", "Test"}) AND ALL speakers.name IN {"John Apple", "Alsey Coleman Miller"}"#)
#endif
}

func testPredicate6() {
Expand Down Expand Up @@ -235,7 +237,9 @@ final class PredicateTests: XCTestCase {
]

XCTAssertEqual(try events.filter(with: predicate), events)
#if !os(WASI)
XCTAssertEqual(predicate.description, #"name MATCHES[c] "event \d" AND start < 4001-01-01 00:00:00 +0000 AND speakers.@count > 0"#)
#endif
}
}

Expand Down

0 comments on commit 1c840fa

Please sign in to comment.