Skip to content

Commit

Permalink
Apply code review edits
Browse files Browse the repository at this point in the history
  • Loading branch information
BNAndras authored and loziniak committed Dec 1, 2023
1 parent d2b70f3 commit a9a74c4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
2 changes: 1 addition & 1 deletion exercises/practice/leap/.meta/example.red
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ leap: function [
year
] [
divisible?: func [n] [zero? year // n]
to logic! any [all [divisible? 4 not divisible? 100] divisible? 400]
to logic! any [all [divisible? 4 not divisible? 100] divisible? 400]
]

17 changes: 5 additions & 12 deletions exercises/practice/leap/leap-test.red
Original file line number Diff line number Diff line change
Expand Up @@ -84,19 +84,12 @@ canonical-cases: [#(


foreach c-case canonical-cases [
expect-code: compose [
(to word! c-case/function) (values-of c-case/input)
case-code: reduce [
'expect c-case/expected compose [
(to word! c-case/function) (values-of c-case/input)
]
]
case-code: reduce
either all [
map? c-case/expected
string? c-case/expected/error
] [
['expect-error/message quote 'user expect-code c-case/expected/error]
] [
['expect c-case/expected expect-code]
]


test c-case/description case-code
]

Expand Down

0 comments on commit a9a74c4

Please sign in to comment.