File: uri_parser_object.rb

package info (click to toggle)
ruby-mustermann 3.0.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,224 kB
  • sloc: ruby: 7,746; makefile: 6
file content (16 lines) | stat: -rw-r--r-- 426 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
require "objspace"
require "uri"
require_relative "../lib/mustermann/ast/translator"

translator = Mustermann::AST::Translator.new
translator.escape("foo")

h1 = ObjectSpace.each_object.inject(Hash.new 0) { |h, o| h[o.class] += 1; h }

100.times do
  translator.escape("foo")
end

h2 = ObjectSpace.each_object.inject(Hash.new 0) { |h, o| h[o.class] += 1; h }

raise if (h2[URI::RFC2396_Parser] - h1[URI::RFC2396_Parser] != 0)