
louise
Clone avec HTTPS, un jeton personnel en mot de passe, ou avec SSH, une clé ajoutée dans vos paramètres.
Dernier runRéussi#1197 · main · 10 min 35 s
1Étoiles
0Forks
0Issues
| 1 | /// Assertions for `louise test`. Tests are functions marked `@test` (in any |
| 2 | /// module, next to the code they test); `@should_panic("text")` expects a |
| 3 | /// panic. A failed assertion (any panic) fails a test. |
| 4 | |
| 5 | pub fn assert :: condition: Bool message: String -> () |
| 6 | { |
| 7 | if !condition |
| 8 | { |
| 9 | panic ("assertion failed: " <> message) |
| 10 | } |
| 11 | } |
| 12 | |
| 13 | pub fn assert_equal :: actual: a expected: a -> () where Eq<a>, Show<a> |
| 14 | { |
| 15 | if actual != expected |
| 16 | { |
| 17 | panic ("expected " <> show expected <> ", got " <> show actual) |
| 18 | } |
| 19 | } |