PageRenderTime 19ms CodeModel.GetById 14ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/specs/hashes/sha1.ds

http://github.com/wilkie/djehuty
Unknown | 19 lines | 15 code | 4 blank | 0 comment | 0 complexity | 9c4098d1d24d5259c91b447bb4af6521 MD5 | raw file
 1module specs.hashes.sha1;
 2
 3import testing.support;
 4
 5import hashes.sha1;
 6
 7describe SHA1() {
 8	describe hash() {
 9		it should_hash_as_expected_for_string_literals() {
10			string s = HashSHA1.hash("a").toString();
11			should(s == "86f7e437faa5a7fce15d1ddcb9eaeaea377667b8");
12		}
13
14		it should_hash_the_empty_string() {
15			string s = HashSHA1.hash("").toString();
16			should(s == "da39a3ee5e6b4b0d3255bfef95601890afd80709");
17		}
18	}
19}