Commit fe89202077fe42c8caf34e3ea16d502652958216

  • avatar
  • Duke Leto <jonathan @le…o.net>
  • Sat Feb 13 02:05:49 CET 2010
Add some basic tests for hash()
t/03-util.t
(11 / 1)
  
1717}
1818
1919sub run_tests () {
20 plan(49);
20 plan(51);
2121
2222 test_hash_exists();
2323 test_hash_keys();
2424 test_hash_values();
2525 test_hash_kv();
26 test_hash();
2627
2728 test_all_matches();
2829
4343 is(@matches[0],'abc','all_matches found abc');
4444 is(@matches[1],'adc','all_matches found adc');
4545 is(@matches[2],'axc','all_matches found axc');
46}
47
48sub test_hash() {
49 my %hash := hash( monkey => 'see');
50 my @kv := %hash.kv;
51
52 is(@kv[0],'monkey', 'has() creates the monkey key');
53 is(@kv[1],'see', 'hash() set the value of monkey correctly');
54
4655}
4756
4857sub test_hash_exists() {