Skip to content

Commit

Permalink
Test should fail if no overflow was detected
Browse files Browse the repository at this point in the history
  • Loading branch information
macmoonshine committed Nov 26, 2023
1 parent 3c24dbd commit 37d593a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# CHANGELOG

**v0.9.0:**
**v0.1.2:**
- Detection of integer overflows during decoding (@thanks to [gh123man](https://github.com/gh123man))

**v0.1.0:**
- Initial implementation of [the spec](https://github.com/sqids/sqids-spec)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Add the following dependency to your Swift `Package.swift`:

```swift
dependencies.append(
.package(url: "https://github.com/sqids/sqids-swift.git", from: "0.1.0")
.package(url: "https://github.com/sqids/sqids-swift.git", from: "0.1.2")
)
```

Expand Down
4 changes: 3 additions & 1 deletion Tests/sqidsTests/EncodeTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@ final class EncodeTests: XCTestCase {
let badInput = try sqids.encode([Int64.max]) + "a"
do {
_ = try sqids.decode(badInput) // Should not crash
XCTFail("Overflow not detected")
}
catch Sqids.Error.overflow {
}
catch Sqids.Error.overflow { }
}
}

0 comments on commit 37d593a

Please sign in to comment.