Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
TST: Add case that fails with seed 0 or 5 for #4
  • Loading branch information
pan14001 committed May 16, 2019
1 parent e131ecb commit ac15023
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/prng.bats
@@ -0,0 +1,25 @@
#!/usr/bin/env bats

# shellcheck disable=1083
true

# shellcheck source=../parallel_opts.sh
. "${BATS_TEST_DIRNAME}/../examples/script_that_sometimes_fails.sh"

@test 'prng fails at least once' {
# shellcheck disable=2034
SLURM_NTASKS=5

for seed in {0..9}
do
result=()
sum=0
for ID in {0..4}
do
result[ID]=$(prng)
sum+=${result[ID]}
done
echo "seed: $seed, prng: ${result[*]}"
[[ $sum -gt 0 ]]
done
}

0 comments on commit ac15023

Please sign in to comment.