Skip to content

Commit 8b2892d

Browse files
committed
Re-add tests that were accidentally removed when resolving conflicts
1 parent 6ceb4f1 commit 8b2892d

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

tests/smoke.rs

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,47 @@ fn f64_inclusive() {
145145
assert!(count_top_half >= 49_000_000);
146146
}
147147

148+
#[test]
149+
fn digit() {
150+
for base in 1..36 {
151+
let result = fastrand::digit(base);
152+
assert!(result.is_ascii_digit() || result.is_ascii_lowercase());
153+
}
154+
}
155+
156+
#[test]
157+
fn global_rng_choice() {
158+
let items = [1, 4, 9, 5, 2, 3, 6, 7, 8, 0];
159+
160+
for item in &items {
161+
while fastrand::choice(&items).unwrap() != item {}
162+
}
163+
}
164+
165+
#[test]
166+
fn global_rng_alphabetic() {
167+
for _ in 0..1000 {
168+
let result = fastrand::alphabetic();
169+
assert!(result.is_ascii_alphabetic())
170+
}
171+
}
172+
173+
#[test]
174+
fn global_rng_lowercase() {
175+
for _ in 0..1000 {
176+
let result = fastrand::lowercase();
177+
assert!(result.is_ascii_lowercase())
178+
}
179+
}
180+
181+
#[test]
182+
fn global_rng_uppercase() {
183+
for _ in 0..1000 {
184+
let result = fastrand::uppercase();
185+
assert!(result.is_ascii_uppercase())
186+
}
187+
}
188+
148189
#[test]
149190
fn fill() {
150191
let mut r = fastrand::Rng::new();

0 commit comments

Comments
 (0)