Sha256: 7d99531d2e3a1f497747f28b152aa944054c1e8b15c44bfaf5431337f0006314

Contents?: true

Size: 657 Bytes

Versions: 66

Compression:

Stored size: 657 Bytes

Contents

#!/usr/bin/env ruby
# encoding: UTF-8

# Ubuntu does not accept arguments to ruby when called using env. To get warnings to show up the -w options is
# required. That can be set in the RUBYOPT environment variable.
# export RUBYOPT=-w

$VERBOSE = true

$: << File.join(File.dirname(__FILE__), "../lib")
$: << File.join(File.dirname(__FILE__), "../ext")

require 'oj'

A = Struct.new(:a,:b,:c,:d)
B = Struct.new(:e,:f)

obj = [A.new(55, B.new(1, 'X'), B.new(2, 'Y'), 3)]

s = Oj.dump(obj, :mode => :object)

100000.times do
  Oj.load(s, :mode => :object)
  # ds = Oj.dump(o, :mode => :object)
  # if ds != s
  #   puts ds
  #   raise "holy crap"
  # end
end

Version data entries

66 entries across 66 versions & 1 rubygems

Version Path
oj-3.7.6 test/struct.rb
oj-2.18.5 test/struct.rb
oj-2.18.4 test/struct.rb
oj-2.18.3 test/struct.rb
oj-2.18.2 test/struct.rb
oj-2.18.1 test/struct.rb
oj-2.18.0 test/struct.rb
oj-2.17.5 test/struct.rb
oj-2.17.3 test/struct.rb
oj-2.17.2 test/struct.rb
oj-2.17.1 test/struct.rb
oj-2.17.0 test/struct.rb
oj-2.16.1 test/struct.rb
oj-2.14.6 test/struct.rb
oj-2.14.5 test/struct.rb
oj-2.14.4 test/struct.rb
oj-2.14.3 test/struct.rb
oj-2.14.2 test/struct.rb
oj-2.14.1 test/struct.rb
oj-2.14.0 test/struct.rb