Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveBronder committed May 16, 2024
1 parent ff66ab9 commit cd57539
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/test/unit/services/util/create_rng_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,12 @@ TEST(rng, initialize_with_zero) {
rng2();
EXPECT_NE(rng1, rng2);
}

TEST(rng, run_twice_with_minus_one_seed) {
stan::rng_t rng1 = stan::services::util::create_rng(-1, 0);
EXPECT_EQ(rng1(), rng1());
}
TEST(rng, run_twice_with_zero_seed) {
stan::rng_t rng1 = stan::services::util::create_rng(0, 0);
EXPECT_NE(rng1(), rng1());
}

0 comments on commit cd57539

Please sign in to comment.