added tests comment
This commit is contained in:
+15
-2
@@ -12,8 +12,8 @@ impl Rng {
|
|||||||
.unwrap()
|
.unwrap()
|
||||||
.subsec_nanos() as u64;
|
.subsec_nanos() as u64;
|
||||||
// Allegedly
|
// Allegedly
|
||||||
// It's XOR'd with the seed (`subsec_nanos()`) as a **mixing step** —
|
// The magic number is XOR'd with the seed (`subsec_nanos()`) as a mixing step.
|
||||||
// the golden ratio has a property where it distributes bits very evenly across
|
// "the golden ratio" has a property where it distributes bits very evenly across
|
||||||
// the range, so even a low-entropy seed gets spread across all 64 bits
|
// the range, so even a low-entropy seed gets spread across all 64 bits
|
||||||
// before the first LCG iteration runs
|
// before the first LCG iteration runs
|
||||||
Self {
|
Self {
|
||||||
@@ -205,3 +205,16 @@ fn print_summary(stats: &[QuestionStats]) {
|
|||||||
);
|
);
|
||||||
println!("\nScore: {}/{}", perfect, stats.len());
|
println!("\nScore: {}/{}", perfect, stats.len());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// tests
|
||||||
|
// * valid integer
|
||||||
|
// * some basic correctness of correct answers
|
||||||
|
// * some basic correctness of incorrect answers
|
||||||
|
//
|
||||||
|
// * invalid integer
|
||||||
|
// * float
|
||||||
|
// * different representation: hex, binary, octect
|
||||||
|
// * unicode
|
||||||
|
// * some specific attacks
|
||||||
|
// * multiple integers
|
||||||
|
//
|
||||||
|
|||||||
Reference in New Issue
Block a user