Comments (3)
I've just done more testing:
I changed the failing test to this, to check if it failed in the same way for all Set
s instanced with that array:
it("should preserve the order of the given input") {
let input = ["a", "c", "b", "a"]
expect(Set(input).joined()) != "acb"
expect(Set(input).joined()) != "acb"
expect(Set(input).joined()) != "acb"
expect(Set(input).joined()) != "acb"
expect(Set(input).joined()) != "acb"
expect(Set(input).joined()) != "acb"
expect(Set(input).joined()) != "acb"
expect(Set(input).joined()) != "acb"
expect(Set(input).joined()) != "acb"
expect(Set(input).joined()) != "acb"
expect(OrderedSet(input).joined()) == "acb"
}
Then I ran swift test
repeatedly many times. The result was something like this:
- 0 failures
- 0 failures
- 0 failures
- 10 failures
- 0 failures
This shows that the test isn't deterministic. Since Set
's implementation uses hash tables, some non-determinisitic hashtable attack protection must be in play.
I dunno what can be done about this test. The OrderedSet
part will always be true, but the Set
part depends on luck. Maybe the Set
part isn't necessary? But I dunno, because I didn't make the test.
from commandant.
Thanks for filling the issue! Your explanation totally makes sense, so let's remove the test.
from commandant.
No problem ;)
from commandant.
Related Issues (20)
- Detect --help, and run help HOT 2
- Dont mangle key typos. HOT 4
- Can't run tests on Linux HOT 6
- Any objections to cutting a release? HOT 2
- Help message for Argument could be improved HOT 2
- Add owners to pod on CocoaPod trunk HOT 1
- Subcommand feature does not work on Ubuntu
- Drop Result dependency and implement Swift 5 Result
- 🍫 Podspec: Unrecognized `swift_version` key. HOT 1
- Aliases
- Cannot install using SPM
- `carthage checkout ` fails on using Commandant v0.8.3 HOT 3
- Adding dependencies to a CommandType's OptionType at init/evaluate time? HOT 5
- How can we declare consuming variadic arguments including `-` prefixed one in `OptionsType` HOT 3
- Recursive commands HOT 2
- The version 0.11 is not recognized with SPM. HOT 7
- swift build on Linux fails
- Release configuration build fails on Linux HOT 2
- Passing a Switch key is ignored if the Switch contains a flag HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from commandant.