tobogganSe connecter

louise

Clone avec HTTPS, un jeton personnel en mot de passe, ou avec SSH, une clé ajoutée dans vos paramètres.

19 lignes · 513 octetsBrut · Historique
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
5pub fn assert :: condition: Bool message: String -> ()
6{
7 if !condition
8 {
9 panic ("assertion failed: " <> message)
10 }
11}
12
13pub 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}