mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Show random seed
Only works when a seed specified, not when a random seed is used.
This commit is contained in:
parent
7aa8cb14a4
commit
ba29c1e032
2 changed files with 17 additions and 0 deletions
14
src/spectator/formatting/random_seed_text.cr
Normal file
14
src/spectator/formatting/random_seed_text.cr
Normal file
|
@ -0,0 +1,14 @@
|
|||
module Spectator::Formatting
|
||||
# Text displayed when using a random seed.
|
||||
private struct RandomSeedText
|
||||
# Creates the text object.
|
||||
def initialize(@seed : UInt64)
|
||||
end
|
||||
|
||||
# Appends the command to the output.
|
||||
def to_s(io)
|
||||
io << "Randomized with seed "
|
||||
io << @seed
|
||||
end
|
||||
end
|
||||
end
|
|
@ -49,6 +49,9 @@ module Spectator::Formatting
|
|||
private def stats(report)
|
||||
@io.puts Runtime.new(report.runtime)
|
||||
@io.puts StatsCounter.new(report).color
|
||||
if (seed = report.random_seed?)
|
||||
@io.puts RandomSeedText.new(seed)
|
||||
end
|
||||
end
|
||||
|
||||
# Produces the skipped tests text if fail-fast is enabled and tests were omitted.
|
||||
|
|
Loading…
Reference in a new issue