jeudi 19 avril 2018

Repeatable random data generation in Swift 4

I'm writing tests in Swift 4. I want to generate thousands of rows of test input data. I want the test input data to be random.

But I want my tests to be repeatable: the same data needs to be generated for each run of all tests.

How is this achieved in Swift? In Java I've always relied on the Apache commons RandomDataGenerator. I've explored arc4random and drand48, but these don't seem to provide the repeatability I require.




Aucun commentaire:

Enregistrer un commentaire