Skip to content

Commit 7aa8ebe

Browse files
David Sheldrickds300
authored andcommitted
make property based tests harder
1 parent f1cd77e commit 7aa8ebe

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/__tests__/propertyBasedTests.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
2020
function makeFileContents() {
2121
return (
2222
generate({
23-
length: Math.floor(Math.random() * 5),
23+
length: Math.floor(Math.random() * 1000),
2424
charset: fileCharSet,
2525
}) || ""
2626
)
2727
}
2828

2929
function makeFileName(ext?: boolean) {
3030
const name = generate({
31-
length: Math.ceil(Math.random() * 12),
31+
length: Math.ceil(Math.random() * 10),
3232
charset: "abcdefghijklmnopqrstuvwxyz-_0987654321",
3333
})
3434

@@ -56,7 +56,7 @@ abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
5656

5757
function makeFiles(): Files {
5858
const fileSystem: { [path: string]: string } = {}
59-
const numFiles = Math.random() * 10 + 1
59+
const numFiles = Math.random() * 3 + 1
6060
for (let i = 0; i < numFiles; i++) {
6161
fileSystem[makeFilePath()] = makeFileContents()
6262
}
@@ -111,7 +111,7 @@ abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
111111
function mutateFiles(files: Files): Files {
112112
const mutatedFiles = { ...files }
113113

114-
const numMutations = Math.ceil(Math.random() * 10)
114+
const numMutations = Math.ceil(Math.random() * 1000)
115115

116116
for (let i = 0; i < numMutations; i++) {
117117
switch (getNextMutationKind()) {
@@ -286,7 +286,7 @@ abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
286286
})
287287
}
288288

289-
for (let i = 0; i < 100; i++) {
289+
for (let i = 0; i < 200; i++) {
290290
executeTest(makeTestCase(), i)
291291
}
292292

0 commit comments

Comments
 (0)