Skip to content

Commit

Permalink
Make the base public (#8)
Browse files Browse the repository at this point in the history
* Make the base public

* Add more tests

* Bump version
  • Loading branch information
PumpkinSeed authored Dec 20, 2024
1 parent 6d94d50 commit 3065a2f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "simplerand"
version = "1.5.0"
version = "1.5.1"
authors = ["PumpkinSeed <[email protected]>"]
edition = "2018"
description = "Simple and fast random number generator"
Expand Down
23 changes: 22 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
mod base;
pub mod base;

#[macro_use]
extern crate lazy_static;
Expand Down Expand Up @@ -887,4 +887,25 @@ mod tests {
let result: u16 = random.rand_range(6, 123);
assert_eq!(result, 93);
}

#[test]
fn random_instance_predictable() {
let random = Random::new(1);
let result: u16 = random.rand_range(6, 123);
assert_eq!(result, 93);

let result: u16 = random.rand_range(6, 123);
assert_eq!(result, 75);
}

#[test]
fn random_instance_predictable_compare() {
let random = Random::new(1);
let result: u16 = random.rand_range(6, 123);
assert_eq!(result, 93);

let random = Random::new(1);
let result: u16 = random.rand_range(6, 123);
assert_eq!(result, 93);
}
}

0 comments on commit 3065a2f

Please sign in to comment.