Commit | Line | Data |
---|---|---|
7f918cf1 CE |
1 | (* Copyright (C) 2009 Matthew Fluet. |
2 | * Copyright (C) 1999-2006 Henry Cejtin, Matthew Fluet, Suresh | |
3 | * Jagannathan, and Stephen Weeks. | |
4 | * | |
5 | * MLton is released under a BSD-style license. | |
6 | * See the file MLton-LICENSE for details. | |
7 | *) | |
8 | ||
9 | (* Base64 encoding, as in RFC 1421 *) | |
10 | ||
11 | signature BASE64 = | |
12 | sig | |
13 | val decode: string -> string | |
14 | val encode: string -> string | |
15 | end | |
16 | ||
17 | ||
18 | functor TestBase64 (S: BASE64): sig end = | |
19 | struct | |
20 | ||
21 | open S | |
22 | ||
23 | val _ = | |
24 | Assert.assert | |
25 | ("TestBase64", fn () => | |
26 | List.forall(["a", "aa", "aaa", "aaaa", "aaaaa", "aaaaaa", "aaaaaaa", | |
27 | "a", "ab", "abc", "abcd", "abcde", "abcdef", "abcdefg", | |
28 | "bb:new.site"], | |
29 | fn s => decode(encode s) = s)) | |
30 | end |