File tree Expand file tree Collapse file tree 2 files changed +41
-0
lines changed Expand file tree Collapse file tree 2 files changed +41
-0
lines changed Original file line number Diff line number Diff line change 1+ def printTimes : List (IO Unit) → IO Unit
2+ | [] => pure ()
3+ | act :: actions => do
4+ printTimes actions
5+ act
6+
7+ def pad : Nat → String
8+ | n + 10 => s! "{ n + 10 } "
9+ | n => s! "0{ n} "
10+
11+ def clock (t : Nat) : String :=
12+ s! "{ pad (if t / 3600 == 0 then 12 else t / 3600 )} :{ pad (t / 60 % 60 )} :{ pad (t % 60 )} "
13+
14+ def countdown : Nat → List (IO Unit)
15+ | 0 => []
16+ | n + 1 => IO.println (clock ((43200 * (n) + 21600 ) / 11 )) :: countdown n
17+
18+ def main : IO Unit := printTimes (countdown 11 )
Original file line number Diff line number Diff line change 1+ function Assert-MatchTests {
2+ param (
3+ [Parameter (Mandatory = $true , ValueFromPipeline )] $TestResult
4+ )
5+
6+ if ($TestResult ) {
7+ Write-Error " Output does not match expected results."
8+ }
9+ }
10+
11+ $Error.clear ()
12+ lean " $PSScriptRoot \ClockHands.lean" |
13+ Compare-Object (Get-Content " $PSScriptRoot \..\test\clockhands_expected" ) |
14+ Assert-MatchTests &&
15+ lean " $PSScriptRoot \Hello.lean" &&
16+ ForEach-Object ' foo'
17+
18+ if ($Error -or ! $? ) {
19+ " *** LEAN TESTS FAILED ***"
20+ }
21+ else {
22+ " LEAN TESTS PASSED"
23+ }
You can’t perform that action at this time.
0 commit comments