Sha256: c77adf645280d2db7188c13eb31d03a9898d87b75d553a58382191a6c276b2e5

Contents?: true

Size: 926 Bytes

Versions: 16

Compression:

Stored size: 926 Bytes

Contents

// Copyright (c) 2017-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/to_string.hpp>
#include <tao/json/value.hpp>

#include <tao/json/events/key_snake_case_to_camel_case.hpp>

namespace tao::json
{
   void test( const value& v, const std::string& s )
   {
      TEST_ASSERT( to_string< events::key_snake_case_to_camel_case >( v ) == s );
   }

   void unit_test()
   {
      test( { { "foo_bar", 42 } }, "{\"fooBar\":42}" );

      test( { { "foo_bar", "foo_bar" } }, "{\"fooBar\":\"foo_bar\"}" );

      test( { { "foo_", 42 } }, "{\"foo_\":42}" );
      test( { { "foo__bar", 42 } }, "{\"foo_Bar\":42}" );
      test( { { "_foo", 42 } }, "{\"Foo\":42}" );
      test( { { "_Foo", 42 } }, "{\"_Foo\":42}" );
      test( { { "foo_Bar", 42 } }, "{\"foo_Bar\":42}" );
   }

}  // namespace tao::json

#include "main.hpp"

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
couchbase-3.0.0.alpha.4-x86_64-linux ext/third_party/json/src/test/json/key_snake_case_to_camel_case.cpp
couchbase-3.0.0.alpha.4-x86_64-darwin-19 ext/third_party/json/src/test/json/key_snake_case_to_camel_case.cpp
couchbase-3.0.0.alpha.4-universal-darwin-19 ext/third_party/json/src/test/json/key_snake_case_to_camel_case.cpp
couchbase-3.0.0.alpha.4 ext/third_party/json/src/test/json/key_snake_case_to_camel_case.cpp
couchbase-3.0.0.alpha.3-x86_64-linux ext/third_party/json/src/test/json/key_snake_case_to_camel_case.cpp
couchbase-3.0.0.alpha.3-x86_64-darwin-19 ext/third_party/json/src/test/json/key_snake_case_to_camel_case.cpp
couchbase-3.0.0.alpha.3-universal-darwin-19 ext/third_party/json/src/test/json/key_snake_case_to_camel_case.cpp
couchbase-3.0.0.alpha.3 ext/third_party/json/src/test/json/key_snake_case_to_camel_case.cpp
couchbase-3.0.0.alpha.2-x86_64-linux ext/third_party/json/src/test/json/key_snake_case_to_camel_case.cpp
couchbase-3.0.0.alpha.2-x86_64-darwin-19 ext/third_party/json/src/test/json/key_snake_case_to_camel_case.cpp
couchbase-3.0.0.alpha.2-universal-darwin-19 ext/third_party/json/src/test/json/key_snake_case_to_camel_case.cpp
couchbase-3.0.0.alpha.2 ext/third_party/json/src/test/json/key_snake_case_to_camel_case.cpp
couchbase-3.0.0.alpha.1-x86_64-linux ext/third_party/json/src/test/json/key_snake_case_to_camel_case.cpp
couchbase-3.0.0.alpha.1-x86_64-darwin-19 ext/third_party/json/src/test/json/key_snake_case_to_camel_case.cpp
couchbase-3.0.0.alpha.1-universal-darwin-19 ext/third_party/json/src/test/json/key_snake_case_to_camel_case.cpp
couchbase-3.0.0.alpha.1 ext/third_party/json/src/test/json/key_snake_case_to_camel_case.cpp