-
Notifications
You must be signed in to change notification settings - Fork 28
Correct spelling and terminology across JSON documentation and tests #65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: unstable
Are you sure you want to change the base?
Changes from all commits
5e7c187
35298d8
5161545
753c3a6
5ff6923
2531042
e3db6eb
6c3de96
881f478
06bc512
0805a9f
f0df0c2
599e706
51f2115
1f051c7
ede3c68
7bb962f
20a7eb8
3d347f2
7d59bfd
aace870
f3bdb44
6099834
61d5229
d6838b2
424d8ab
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -71,7 +71,7 @@ RAPIDJSON_DIAG_OFF(effc++) | |
| \ingroup RAPIDJSON_ERRORS | ||
| \brief Macro to indicate a parse error. | ||
| \param parseErrorCode \ref rapidjson::ParseErrorCode of the error | ||
| \param offset position of the error in JSON input (\c size_t) | ||
| \param offset position of the error in JSON input (\c size_t) | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. there were a couple of places where things appeared to be intentionally indented. This doesn't appear to be one of those cases... |
||
|
|
||
| This macros can be used as a customization point for the internal | ||
| error handling mechanism of RapidJSON. | ||
|
|
@@ -109,7 +109,7 @@ RAPIDJSON_DIAG_OFF(effc++) | |
| \ingroup RAPIDJSON_ERRORS | ||
| \brief (Internal) macro to indicate and handle a parse error. | ||
| \param parseErrorCode \ref rapidjson::ParseErrorCode of the error | ||
| \param offset position of the error in JSON input (\c size_t) | ||
| \param offset position of the error in JSON input (\c size_t) | ||
|
|
||
| Invokes RAPIDJSON_PARSE_ERROR_NORETURN and stops the parsing. | ||
|
|
||
|
|
@@ -1210,7 +1210,7 @@ class GenericReader { | |
| is.dst_ = q; | ||
| } | ||
|
|
||
| // When read/write pointers are the same for insitu stream, just skip unescaped characters | ||
| // When read/write pointers are the same for in situ stream, just skip unescaped characters | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thi is the proper spelling for the phrase. https://en.wikipedia.org/wiki/In_situ Note that I'm not changingt the class as that seemed a bit too invasive... |
||
| static RAPIDJSON_FORCEINLINE void SkipUnescapedString(InsituStringStream& is) { | ||
| RAPIDJSON_ASSERT(is.src_ == is.dst_); | ||
| char* p = is.src_; | ||
|
|
@@ -1382,7 +1382,7 @@ class GenericReader { | |
| is.dst_ = q; | ||
| } | ||
|
|
||
| // When read/write pointers are the same for insitu stream, just skip unescaped characters | ||
| // When read/write pointers are the same for in situ stream, just skip unescaped characters | ||
| static RAPIDJSON_FORCEINLINE void SkipUnescapedString(InsituStringStream& is) { | ||
| RAPIDJSON_ASSERT(is.src_ == is.dst_); | ||
| char* p = is.src_; | ||
|
|
@@ -1428,7 +1428,7 @@ class GenericReader { | |
| is.src_ = is.dst_ = p; | ||
| } | ||
| #else | ||
| // When read/write pointers are the same for insitu stream, just skip unescaped characters | ||
| // When read/write pointers are the same for in situ stream, just skip unescaped characters | ||
| static RAPIDJSON_FORCEINLINE void SkipUnescapedString(InsituStringStream& is) { | ||
| RAPIDJSON_ASSERT(is.src_ == is.dst_); | ||
| char* p = is.src_; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -514,8 +514,8 @@ def test_json_get_command_supports_all_datatypes(self): | |
| for (path, value) in [('.firstName', '"John"'), # string | ||
| ('.address.city', '"New York"'), # string | ||
| ('.spouse', 'null'), # null | ||
| ('.children', '[]'), # empy array | ||
| ('.groups', '{}'), # empy object | ||
| ('.children', '[]'), # empty array | ||
| ('.groups', '{}'), # empty object | ||
| ('.isAlive', 'true'), # boolean | ||
| ('.age', '27')]: # float number | ||
| assert value.encode() == client.execute_command( | ||
|
|
@@ -525,7 +525,7 @@ def test_json_get_command_supports_all_datatypes(self): | |
| assert value == client.execute_command( | ||
| 'JSON.GET', wikipedia, path).decode() | ||
|
|
||
| def test_json_path_syntax_objectkeys(self): | ||
| def test_json_path_syntax_object_keys(self): | ||
| client = self.server.get_new_client() | ||
| for (path, value) in [('["firstName"]', '"John"'), | ||
| ('address[\'city\']', '"New York"'), | ||
|
|
@@ -832,7 +832,7 @@ def test_json_get_legacy_and_v2path_wildcard(self): | |
| assert exp == client.execute_command( | ||
| 'JSON.GET', key, path) | ||
|
|
||
| # Legacy path returns non-existent error if no value is selected. | ||
| # Legacy path returns nonexistent error if no value is selected. | ||
| for (key, path, exp) in [ | ||
| (k1, '.a[*]', None), | ||
| (k2, '.a.*', None) | ||
|
|
@@ -1013,7 +1013,7 @@ def test_json_get_v2path_array_union(self): | |
| ]: | ||
| assert exp.encode() == client.execute_command('JSON.GET', k2, path) | ||
|
|
||
| # we do not support mixing of unions and slices, nor do we support extraneous commas | ||
| # we do not support mixing of unions and slices, nor do we support extraneous commas | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is why I included the commit to fix the doubled whitespace. actually, this line helped me realize that one of my own rules was broken -- one of the benefits I get from running my rules against other projects is identifying bugs in them and fixing them... |
||
| for path in [ | ||
| '$[0,1,2:4]', | ||
| '$[0:2,3,4]', | ||
|
|
@@ -1541,7 +1541,7 @@ def test_json_double_consistency(self): | |
| ''' | ||
| Test that double values remain consistent when going through JSON Engine. | ||
| This tests a tolerance of 2^-50 for a decent number of iterations, | ||
| but is not enough to guarantee that level of presicion to our customers. | ||
| but is not enough to guarantee that level of precision to our customers. | ||
| Also verify that regular and pretty print double values have the same output. | ||
| ''' | ||
| client = self.server.get_new_client() | ||
|
|
@@ -1902,7 +1902,7 @@ def test_json_strappend_command_legacy_and_jsonpath_wildcard(self): | |
| assert exp_new_str == client.execute_command( | ||
| 'JSON.GET', key, path).decode() | ||
|
|
||
| def test_json_objectlen_command(self): | ||
| def test_json_object_len_command(self): | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the actual things are |
||
| client = self.server.get_new_client() | ||
| assert 4 == client.execute_command( | ||
| 'JSON.OBJLEN', wikipedia, '.address') | ||
|
|
@@ -1973,7 +1973,7 @@ def test_json_objlen_command_jsonpath_wildcard(self): | |
| 'JSON.OBJLEN', key, path) | ||
| assert self.error_class.is_wrongtype_error(str(e.value)) | ||
|
|
||
| def test_json_objectkeys_command(self): | ||
| def test_json_object_keys_command(self): | ||
| client = self.server.get_new_client() | ||
| obj_keys = [b'street', b'city', b'state', b'zipcode'] | ||
| assert obj_keys == client.execute_command( | ||
|
|
@@ -2709,13 +2709,13 @@ def test_json_resp_command_jsonpath(self): | |
| [b'number', b'646 555-4567']] | ||
|
|
||
| def test_json_debug_memory(self): | ||
| # non-existent key | ||
| # nonexistent key | ||
| client = self.server.get_new_client() | ||
|
|
||
| assert None == client.execute_command( | ||
| 'JSON.DEBUG MEMORY', nonexistentkey) | ||
|
|
||
| # non-existent path | ||
| # nonexistent path | ||
| with pytest.raises(ResponseError) as e: | ||
| client.execute_command( | ||
| 'JSON.DEBUG MEMORY', wikipedia, nonexistentpath) | ||
|
|
@@ -2743,9 +2743,9 @@ def test_json_debug_memory(self): | |
|
|
||
| # Verify the document size calculated by the "per document memory tracking" machinery matches the size | ||
| # calculated by the method of walking the JSON tree. | ||
| metadate_val = client.execute_command('JSON.DEBUG','MEMORY',wikipedia) | ||
| metadata_val = client.execute_command('JSON.DEBUG','MEMORY',wikipedia) | ||
| exp_val = client.execute_command('JSON.DEBUG','MEMORY',wikipedia,'.') | ||
| assert exp_val == metadate_val | ||
| assert exp_val == metadata_val | ||
|
|
||
| def test_keytable_corrupt_injects_handle(self): | ||
| """JSON.DEBUG KEYTABLE-CORRUPT should inject a handle that KEYTABLE-CHECK detects as a mismatch.""" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -60,7 +60,7 @@ extern size_t hash_function(const char *, size_t); | |
| void SetupAllocFuncs(size_t numShards) { | ||
| setupValkeyModulePointers(); | ||
| // | ||
| // Now setup the KeyTable, the RapidJson library now depends on it | ||
| // Now set up the KeyTable, the RapidJson library now depends on it | ||
| // | ||
| KeyTable::Config c; | ||
| c.malloc = dom_alloc; | ||
|
|
@@ -1865,7 +1865,7 @@ TEST_F(DomTest, testToggle_v2path) { | |
| dom_free_doc(d1); | ||
| } | ||
|
|
||
| TEST_F(DomTest, testNumMutiBy_int64) { | ||
| TEST_F(DomTest, testNumMultiBy_int64) { | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd personally favor |
||
| jsn::vector<double> res; | ||
| bool isV2Path; | ||
| JParser parser; | ||
|
|
@@ -1888,7 +1888,7 @@ TEST_F(DomTest, testNumMutiBy_int64) { | |
| EXPECT_FALSE(isV2Path); | ||
| } | ||
|
|
||
| TEST_F(DomTest, testNumMutiBy_double) { | ||
| TEST_F(DomTest, testNumMultiBy_double) { | ||
| const char *new_val = "1"; | ||
| JsonUtilCode rc = dom_set_value(nullptr, doc1, ".foo", new_val, false, false); | ||
| EXPECT_EQ(rc, JSONUTIL_SUCCESS); | ||
|
|
@@ -1912,7 +1912,7 @@ TEST_F(DomTest, testNumMutiBy_double) { | |
| EXPECT_FALSE(isV2Path); | ||
| } | ||
|
|
||
| TEST_F(DomTest, testNumMutiBy_int64_overflow) { | ||
| TEST_F(DomTest, testNumMultiBy_int64_overflow) { | ||
| const char *new_val = "9223372036854775800"; | ||
| JsonUtilCode rc = dom_set_value(nullptr, doc1, ".foo", new_val, false, false); | ||
| EXPECT_EQ(rc, JSONUTIL_SUCCESS); | ||
|
|
@@ -1941,7 +1941,7 @@ TEST_F(DomTest, testNumMutiBy_int64_overflow) { | |
| EXPECT_FALSE(isV2Path); | ||
| } | ||
|
|
||
| TEST_F(DomTest, testNumMutiBy_int64_overflow_negative) { | ||
| TEST_F(DomTest, testNumMultiBy_int64_overflow_negative) { | ||
| const char *new_val = "-9223372036854775808"; | ||
| JsonUtilCode rc = dom_set_value(nullptr, doc1, ".foo", new_val, false, false); | ||
| EXPECT_EQ(rc, JSONUTIL_SUCCESS); | ||
|
|
@@ -1975,7 +1975,7 @@ TEST_F(DomTest, testNumMutiBy_int64_overflow_negative) { | |
| EXPECT_FALSE(isV2Path); | ||
| } | ||
|
|
||
| TEST_F(DomTest, testNumMutiBy_double_overflow) { | ||
| TEST_F(DomTest, testNumMultiBy_double_overflow) { | ||
| const char *new_val = "1.7e308"; | ||
| JsonUtilCode rc = dom_set_value(nullptr, doc1, ".foo", new_val, false, false); | ||
| EXPECT_EQ(rc, JSONUTIL_SUCCESS); | ||
|
|
@@ -2001,7 +2001,7 @@ TEST_F(DomTest, testNumMutiBy_double_overflow) { | |
| EXPECT_FALSE(isV2Path); | ||
| } | ||
|
|
||
| TEST_F(DomTest, testNumMutiBy_double_overflow_negative) { | ||
| TEST_F(DomTest, testNumMultiBy_double_overflow_negative) { | ||
| const char *new_val = "1.7e308"; | ||
| JsonUtilCode rc = dom_set_value(nullptr, doc1, ".foo", new_val, false, false); | ||
| EXPECT_EQ(rc, JSONUTIL_SUCCESS); | ||
|
|
@@ -2895,7 +2895,7 @@ TEST_F(DomTest, testSelector_get_array_legacyPath) { | |
| EXPECT_TRUE(selector.getResultSet().empty()); | ||
| } | ||
|
|
||
| TEST_F(DomTest, testSelector_get_array_negativeIndex_legacy_and_v2ath) { | ||
| TEST_F(DomTest, testSelector_get_array_negativeIndex_legacy_and_v2path) { | ||
| const char *path = ".phoneNumbers[-1]"; | ||
| Selector selector; | ||
| JsonUtilCode rc = selector.getValues(*doc1, path); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -487,7 +487,7 @@ TEST_F(SelectorTest, test_filterExpr_expression_part7) { | |
| " \"poquo value\" : \"\\\"\"," | ||
| " \"my key\" : \"key inside here\"" | ||
| " }," | ||
| " \"anonther object\" : {" | ||
| " \"another object\" : {" | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. GitHub CI passes... |
||
| " \"weight\" : 400," | ||
| " \"a value\" : 400," | ||
| " \"poquo value\" : \"'\"," | ||
|
|
@@ -612,7 +612,7 @@ TEST_F(SelectorTest, test_filterExpr_single_recursion_array) { | |
| dom_free_doc(d1); | ||
| } | ||
|
|
||
| TEST_F(SelectorTest, test_filertExpr_array_index_single_recursion) { | ||
| TEST_F(SelectorTest, test_filterExpr_array_index_single_recursion) { | ||
| JDocument *d1; | ||
| JsonUtilCode rc = dom_parse(nullptr, node_accounts, strlen(node_accounts), &d1); | ||
| EXPECT_EQ(rc, JSONUTIL_SUCCESS); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't usually make commits to drop spaces... this one seems like a pretty good candidate for dropping...