| 650 | } |
| 651 | |
| 652 | void |
| 653 | testOstream() |
| 654 | { |
| 655 | for(string_view js : { |
| 656 | "{\"1\":{},\"2\":[],\"3\":\"x\",\"4\":1," |
| 657 | "\"5\":-1,\"6\":144.0,\"7\":false,\"8\":null}", |
| 658 | "[1,2,3,4,5]" |
| 659 | }) |
| 660 | { |
| 661 | system::error_code ec; |
| 662 | auto const jv1 = parse(js, ec); |
| 663 | if(! BOOST_TEST(! ec)) |
| 664 | return; |
| 665 | auto const jv2 = |
| 666 | parse(to_ostream(jv1), ec); |
| 667 | if(! BOOST_TEST(! ec)) |
| 668 | return; |
| 669 | if(! BOOST_TEST(equal(jv1, jv2))) |
| 670 | log << |
| 671 | " " << js << "\n" |
| 672 | " " << jv1 << "\n" |
| 673 | " " << jv2 << |
| 674 | std::endl; |
| 675 | } |
| 676 | } |
| 677 | |
| 678 | void |
| 679 | testNumberRoundTrips() |