about summary refs log tree commit
path: root/test.rb
diff options
context:
space:
mode:
authorcodeout <goodies@codeout.net>2012-10-03 20:57:13 +0900
committerEric Wong <normalperson@yhbt.net>2012-10-04 03:20:43 -0700
commit523c6a46b06a726d63aa7a27840b79586f356bb5 (patch)
treee1db845c24704b15dda6c4706f58b13744ecc77d /test.rb
parenta5be0f72618bcb2c82ee5131f4899abb3d9db529 (diff)
downloadrpatricia-523c6a46b06a726d63aa7a27840b79586f356bb5.tar.gz
Added a method 'nodes' to return all nodes in ruby's Hash.
This is useful when a ruby code requires nodes list for example,
and also it helps when we sort user data by prefix.

[ew: minor compiler compatibility fixes]
Diffstat (limited to 'test.rb')
-rw-r--r--test.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/test.rb b/test.rb
index 09a11d0..6a2a066 100644
--- a/test.rb
+++ b/test.rb
@@ -60,4 +60,7 @@ my_test(4 == t.num_nodes)
 puts "test: showing all nodes"
 t.show_nodes
 
+puts "test: return all nodes in Hash"
+my_test(t.nodes == {"127.0.0.0/24"=>"", "192.168.1.0/24"=>"", "192.168.2.0/24"=>"", "192.168.3.100/32"=>""})
+
 t.destroy