Skip to content

Commit

Permalink
Use spaces for indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
pwojcikdev committed Feb 1, 2024
1 parent fde4588 commit 3805e36
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 63 deletions.
124 changes: 62 additions & 62 deletions nano/core_test/object_stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,10 @@ TEST (object_stream, object_writer_basic)

auto expected = trim (R"(
object_field: {
field1: "value1",
field2: "value2",
field3: true,
field4: 1234
field1: "value1",
field2: "value2",
field3: true,
field4: 1234
}
)");

Expand Down Expand Up @@ -243,15 +243,15 @@ TEST (object_stream, object_writer_nested)

auto expected = trim (R"(
object_field: {
field1: "value1",
nested_object: {
nested_field1: "nested_value1",
nested_field2: false,
nested_field3: -1234
},
field2: "value2",
field3: true,
field4: 1234
field1: "value1",
nested_object: {
nested_field1: "nested_value1",
nested_field2: false,
nested_field3: -1234
},
field2: "value2",
field3: true,
field4: 1234
}
)");

Expand All @@ -269,9 +269,9 @@ TEST (object_stream, array_writer_basic)

auto expected = trim (R"(
array_field: [
0,
1,
2
0,
1,
2
]
)");

Expand Down Expand Up @@ -304,8 +304,8 @@ TEST (object_stream, object_basic)

auto expected = trim (R"(
test_object: {
uint256_union_field: "0000000000000000000000000000000000000000000000000000000000000000",
block_hash: "0000000000000000000000000000000000000000000000000000000000000000"
uint256_union_field: "0000000000000000000000000000000000000000000000000000000000000000",
block_hash: "0000000000000000000000000000000000000000000000000000000000000000"
}
)");

Expand All @@ -328,18 +328,18 @@ TEST (object_stream, array_writer_objects)

auto expected = trim (R"(
array_field: [
{
uint256_union_field: "0000000000000000000000000000000000000000000000000000000000000000",
block_hash: "0000000000000000000000000000000000000000000000000000000000000000"
},
{
uint256_union_field: "0000000000000000000000000000000000000000000000000000000000000000",
block_hash: "0000000000000000000000000000000000000000000000000000000000000001"
},
{
uint256_union_field: "0000000000000000000000000000000000000000000000000000000000000000",
block_hash: "0000000000000000000000000000000000000000000000000000000000000002"
}
{
uint256_union_field: "0000000000000000000000000000000000000000000000000000000000000000",
block_hash: "0000000000000000000000000000000000000000000000000000000000000000"
},
{
uint256_union_field: "0000000000000000000000000000000000000000000000000000000000000000",
block_hash: "0000000000000000000000000000000000000000000000000000000000000001"
},
{
uint256_union_field: "0000000000000000000000000000000000000000000000000000000000000000",
block_hash: "0000000000000000000000000000000000000000000000000000000000000002"
}
]
)");

Expand Down Expand Up @@ -370,9 +370,9 @@ TEST (object_stream, object_array_basic)

auto expected = trim (R"(
test_object_array: [
1,
2,
3
1,
2,
3
]
)");

Expand Down Expand Up @@ -410,17 +410,17 @@ TEST (object_stream, object_nested)

auto expected = trim (R"(
test_object: {
uint256_union_field: "0000000000000000000000000000000000000000000000000000000000000000",
block_hash: "0000000000000000000000000000000000000000000000000000000000000000",
nested_object: {
uint256_union_field: "0000000000000000000000000000000000000000000000000000000000000000",
block_hash: "0000000000000000000000000000000000000000000000000000000000000000"
},
nested_array_object: [
1,
2,
3
]
uint256_union_field: "0000000000000000000000000000000000000000000000000000000000000000",
block_hash: "0000000000000000000000000000000000000000000000000000000000000000",
nested_object: {
uint256_union_field: "0000000000000000000000000000000000000000000000000000000000000000",
block_hash: "0000000000000000000000000000000000000000000000000000000000000000"
},
nested_array_object: [
1,
2,
3
]
}
)");

Expand Down Expand Up @@ -455,18 +455,18 @@ TEST (object_stream, builtin_array)

auto expected = trim (R"(
array_field: [
{
hash: "0000000000000000000000000000000000000000000000000000000000000001",
value: 1
},
{
hash: "0000000000000000000000000000000000000000000000000000000000000002",
value: 2
},
{
hash: "0000000000000000000000000000000000000000000000000000000000000003",
value: 3
}
{
hash: "0000000000000000000000000000000000000000000000000000000000000001",
value: 1
},
{
hash: "0000000000000000000000000000000000000000000000000000000000000002",
value: 2
},
{
hash: "0000000000000000000000000000000000000000000000000000000000000003",
value: 3
}
]
)");

Expand Down Expand Up @@ -501,8 +501,8 @@ TEST (object_stream, ostream_adapter)

auto expected = trim (R"(
{
uint256_union_field: "0000000000000000000000000000000000000000000000000000000000000000",
block_hash: "0000000000000000000000000000000000000000000000000000000000000000"
uint256_union_field: "0000000000000000000000000000000000000000000000000000000000000000",
block_hash: "0000000000000000000000000000000000000000000000000000000000000000"
}
)");

Expand All @@ -518,8 +518,8 @@ TEST (object_stream, fmt_adapter)

auto expected = trim (R"(
{
uint256_union_field: "0000000000000000000000000000000000000000000000000000000000000000",
block_hash: "0000000000000000000000000000000000000000000000000000000000000000"
uint256_union_field: "0000000000000000000000000000000000000000000000000000000000000000",
block_hash: "0000000000000000000000000000000000000000000000000000000000000000"
}
)");

Expand All @@ -536,8 +536,8 @@ TEST (object_stream, to_string)

auto expected = trim (R"(
{
uint256_union_field: "0000000000000000000000000000000000000000000000000000000000000000",
block_hash: "0000000000000000000000000000000000000000000000000000000000000000"
uint256_union_field: "0000000000000000000000000000000000000000000000000000000000000000",
block_hash: "0000000000000000000000000000000000000000000000000000000000000000"
}
)");

Expand Down
2 changes: 1 addition & 1 deletion nano/lib/object_stream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ struct object_stream_config
std::string false_value{ "false" };
std::string null_value{ "null" };

std::string indent{ "\t" };
std::string indent{ " " };
std::string newline{ "\n" };

/** Number of decimal places to show for `float` and `double` */
Expand Down

0 comments on commit 3805e36

Please sign in to comment.