summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorsvu <svu>2006-10-26 22:56:06 +0000
committersvu <svu>2006-10-26 22:56:06 +0000
commit08d0a8fc445f7da840a1afa7426bd2896ec2646c (patch)
tree2428a15b22c4ef8798bb6a45b45f8088784dbd88 /tests
parentf9beb392f4671b68119163012e4d12e5e45f7e5c (diff)
downloadxkeyboard-config-08d0a8fc445f7da840a1afa7426bd2896ec2646c.tar.gz
rough xkb_symbols size is primted
Diffstat (limited to 'tests')
-rw-r--r--tests/ruby/find_match.rb2
-rw-r--r--tests/ruby/xkbparser.rb10
2 files changed, 11 insertions, 1 deletions
diff --git a/tests/ruby/find_match.rb b/tests/ruby/find_match.rb
index 6335d95..c1f2d11 100644
--- a/tests/ruby/find_match.rb
+++ b/tests/ruby/find_match.rb
@@ -30,7 +30,7 @@ newSyms.find_all do | key, value |
end
sorted.find_all do | symsName, diff |
- puts " #{symsName} (difference #{diff.size})-> #{diff}"
+ puts " #{symsName}, up to #{allSyms[symsName].rough_size} keys (difference #{diff.size})-> #{diff}"
end
end
diff --git a/tests/ruby/xkbparser.rb b/tests/ruby/xkbparser.rb
index 27eb258..a023dca 100644
--- a/tests/ruby/xkbparser.rb
+++ b/tests/ruby/xkbparser.rb
@@ -58,6 +58,16 @@ class Symbols < Hash
end
#
+ # Approximate size - does not take into account overlapping key definitions
+ #
+ def rough_size()
+ @includedSyms.inject(size) do | sum, symsName |
+ syms = @symbolsList[symsName]
+ syms.size + sum
+ end
+ end
+
+ #
# Create a hash including all elements of this hash which are not in the
# other hash, use symbols + and * for marking the elements which existed in
# the original hash (+ if not existed)