Skip to content

Commit

Permalink
Add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonas-Sander committed Feb 26, 2024
1 parent e806efe commit 72edc2a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/test_randomness/lib/src/test_randomness.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,18 @@ import 'dart:math';

import 'package:random_string/random_string.dart' as lib;

/// The seed to use for randomness.
///
/// This is used to ensure that tests are deterministic.
/// The `TEST_RANDOMNESS_SEED` environment variable will be provided when
/// running `sz test`.
const randomnessSeed =
int.fromEnvironment('TEST_RANDOMNESS_SEED', defaultValue: 0);

/// The [Random] that should be used for randomness in tests.
///
/// This is a [Random] that is seeded with [randomnessSeed].
/// This is used to ensure that tests are deterministic.
final szTestRandom = Random(randomnessSeed);

final _randomProvider = lib.CoreRandomProvider.from(szTestRandom);
Expand Down

0 comments on commit 72edc2a

Please sign in to comment.