@@ -44,7 +44,7 @@ test:test('clock', function(test)
4444end )
4545
4646test :test (' history' , function (test )
47- test :plan (9 )
47+ test :plan (12 )
4848 test :isnt (history .new (), nil , " history.new()" )
4949
5050 local h = history .new ()
@@ -72,18 +72,21 @@ test:test('history', function(test)
7272
7373 h = history .new ()
7474 h :add ({ type = ' ok' , value = 2 })
75- local ref_str = ' [{"type":"ok","value":2}]'
76- test :is (h :to_json (), ref_str , " history_obj:to_json(): { type = 'ok' }" )
75+ local history_json = h :to_json ()
76+ test :like (history_json , ' "value":2' )
77+ test :like (history_json , ' "type":"ok"' )
7778
7879 h = history .new ()
7980 h :add ({ type = ' fail' , value = 3 })
80- ref_str = ' [{"type":"fail","value":3}]'
81- test :is (h :to_json (), ref_str , " history_obj:to_json(): { type = 'fail' }" )
81+ history_json = h :to_json ()
82+ test :like (history_json , ' "value":3' )
83+ test :like (history_json , ' "type":"fail"' )
8284
8385 h = history .new ()
8486 h :add ({ type = ' invoke' , value = 6 })
85- ref_str = ' [{"type":"invoke","value":6}]'
86- test :is (h :to_json (), ref_str , " history_obj:to_json(): { type = 'invoke' }" )
87+ history_json = h :to_json ()
88+ test :like (history_json , ' "value":6' )
89+ test :like (history_json , ' "type":"invoke"' )
8790end )
8891
8992test :test (' op' , function (test )
0 commit comments