Sha256: 19b7466bae3fc2b410817bdf888c0ccc90ff2f28d66a599fe1031c2a31785daf
Contents?: true
Size: 1.3 KB
Versions: 16
Compression:
Stored size: 1.3 KB
Contents
// Copyright (c) 2018-2020 Dr. Colin Hirsch and Daniel Frey // Please see LICENSE for license or visit https://github.com/taocpp/json/ #include "test.hpp" #include <tao/json/contrib/position.hpp> namespace tao::json { void test_json() { const std::string f = "tests/taocpp/position.json"; auto v = from_file_with_position( f ); TEST_ASSERT( v.source() == f ); TEST_ASSERT( v.line() == 1 ); TEST_ASSERT( v.byte_in_line() == 0 ); TEST_ASSERT( v.at( 0 ).source() == f ); TEST_ASSERT( v.at( 0 ).line() == 2 ); TEST_ASSERT( v.at( 0 ).byte_in_line() == 8 ); TEST_ASSERT( v.at( 1 ).source() == f ); TEST_ASSERT( v.at( 1 ).line() == 3 ); TEST_ASSERT( v.at( 1 ).byte_in_line() == 8 ); TEST_ASSERT( v.at( 2 ).source() == f ); TEST_ASSERT( v.at( 2 ).line() == 4 ); TEST_ASSERT( v.at( 2 ).byte_in_line() == 8 ); TEST_ASSERT( v.at( 3 ).source() == f ); TEST_ASSERT( v.at( 3 ).line() == 5 ); TEST_ASSERT( v.at( 3 ).byte_in_line() == 8 ); TEST_ASSERT( v.at( 3 ).at( "hello" ).source() == f ); TEST_ASSERT( v.at( 3 ).at( "hello" ).line() == 6 ); TEST_ASSERT( v.at( 3 ).at( "hello" ).byte_in_line() == 26 ); } void unit_test() { test_json(); } } // namespace tao::json #include "main.hpp"
Version data entries
16 entries across 16 versions & 1 rubygems