GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Description: Ruby WDDX gem.
Homepage: http://code.juretta.com/ruby/wddx/
Clone URL: git://github.com/juretta/wddx.git
juretta (author)
Wed Apr 30 23:20:38 -0700 2008
commit  3d5df54c4cc87211b70f321a16271c28aff2e634
tree    a1a7d48da1700c43999773930572d9930cf66ba7
parent  8003c797e107a041ed79afb8e4f048241d2241a6 parent  d4aab5d09f48e6950d7104bb432d76a0a9a3e80f
wddx / test / tc_wddx_complex_test.rb
100755 25 lines (20 sloc) 0.615 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# $Id: tc_wddx_complex_test.rb 94 2006-12-24 13:05:36Z stefan $
 
require File.dirname(__FILE__) + '/test_helper.rb'
 
class TcWddxComplexTest < Test::Unit::TestCase
  
  def test_dump_load_1
    # Time.now,
    vals = [Math::PI, "A string", 123123, [[nil],[2],[1], [["A"], "B"], [[[6], [[6]]]]], {"a_key" => 3.2}].freeze
    w = []
    200.times do |i|
      w << vals[rand(7)]
    end
    
    actual = WDDX.load(WDDX.dump(w)).data
    w.each_with_index do |val,i|
      if val.kind_of?(Float)
        assert(val.to_s == actual[i].to_s)
      else
        assert_equal val, actual[i]
      end
    end
  end
  
end