Browse Source

Fix typos

Kian-Meng Ang 3 years ago
parent
commit
c3cd3bdbcd
4 changed files with 6 additions and 6 deletions
  1. 1 1
      doc/jsone.md
  2. 2 2
      src/jsone.erl
  3. 2 2
      test/jsone_decode_tests.erl
  4. 1 1
      test/jsone_encode_tests.erl

+ 1 - 1
doc/jsone.md

@@ -149,7 +149,7 @@ encode_option() = native_utf8 | native_forward_slash | canonical_form | {float_f
 - NOTE: If `scalar` or `value` option is specified, non `json_string()` key will be automatically converted to a `binary()` value (e.g. `1` => `<<"1">>`, `#{}` => `<<"{}">>`) <br />
 - NOTE: If `scalar` or `value` option is specified, non `json_string()` key will be automatically converted to a `binary()` value (e.g. `1` => `<<"1">>`, `#{}` => `<<"{}">>`) <br />
 
 
 `{space, N}`: <br />
 `{space, N}`: <br />
-- Inserts `N` spaces after every commna and colon <br />
+- Inserts `N` spaces after every comma and colon <br />
 - default: `0` <br />
 - default: `0` <br />
 
 
 `{indent, N}`: <br />
 `{indent, N}`: <br />

+ 2 - 2
src/jsone.erl

@@ -232,7 +232,7 @@
 %% - NOTE: If `scalar' or `value' option is specified, non `json_string()' key will be automatically converted to a `binary()' value (e.g. `1' => `<<"1">>', `#{}' => `<<"{}">>') <br />
 %% - NOTE: If `scalar' or `value' option is specified, non `json_string()' key will be automatically converted to a `binary()' value (e.g. `1' => `<<"1">>', `#{}' => `<<"{}">>') <br />
 %%
 %%
 %% `{space, N}': <br />
 %% `{space, N}': <br />
-%% - Inserts `N' spaces after every commna and colon <br />
+%% - Inserts `N' spaces after every comma and colon <br />
 %% - default: `0' <br />
 %% - default: `0' <br />
 %%
 %%
 %% `{indent, N}': <br />
 %% `{indent, N}': <br />
@@ -240,7 +240,7 @@
 %% - default: `0' <br />
 %% - default: `0' <br />
 %%
 %%
 %% `skip_undefined': <br />
 %% `skip_undefined': <br />
-%% - If speficied, each entry having `undefined' value in a object isn't included in the result JSON <br />
+%% - If specified, each entry having `undefined' value in a object isn't included in the result JSON <br />
 %%
 %%
 %% `{map_unknown_value, Fun}`: <br />
 %% `{map_unknown_value, Fun}`: <br />
 %% - If `Fun' is a function, unknown values encountered during an encoding process are converted to `json_value()` by applying `Fun'. <br />
 %% - If `Fun' is a function, unknown values encountered during an encoding process are converted to `json_value()` by applying `Fun'. <br />

+ 2 - 2
test/jsone_decode_tests.erl

@@ -62,8 +62,8 @@ decode_test_() ->
               ?assertMatch({error, {badarg, _}}, jsone_decode:decode(<<".123">>)),  % omitted integer part
               ?assertMatch({error, {badarg, _}}, jsone_decode:decode(<<".123">>)),  % omitted integer part
               ?assertMatch({error, {badarg, _}}, jsone_decode:decode(<<"0.">>)),  % omitted fraction part: EOS
               ?assertMatch({error, {badarg, _}}, jsone_decode:decode(<<"0.">>)),  % omitted fraction part: EOS
               ?assertMatch({error, {badarg, _}}, jsone_decode:decode(<<"0.e+3">>)),  % omitted fraction part: with exponent part
               ?assertMatch({error, {badarg, _}}, jsone_decode:decode(<<"0.e+3">>)),  % omitted fraction part: with exponent part
-              ?assertMatch({error, {badarg, _}}, jsone_decode:decode(<<"0.1e">>)),  % imcomplete fraction part
-              ?assertMatch({error, {badarg, _}}, jsone_decode:decode(<<"0.1e-">>)),  % imcomplete fraction part
+              ?assertMatch({error, {badarg, _}}, jsone_decode:decode(<<"0.1e">>)),  % incomplete fraction part
+              ?assertMatch({error, {badarg, _}}, jsone_decode:decode(<<"0.1e-">>)),  % incomplete fraction part
               ?assertMatch({error, {badarg, _}}, jsone_decode:decode(<<"0.1ee-1">>)),  % duplicated 'e'
               ?assertMatch({error, {badarg, _}}, jsone_decode:decode(<<"0.1ee-1">>)),  % duplicated 'e'
               ?assertMatch({error, {badarg, _}}, jsone_decode:decode(<<"0.1e--1">>)),  % duplicated sign
               ?assertMatch({error, {badarg, _}}, jsone_decode:decode(<<"0.1e--1">>)),  % duplicated sign
               ?assertMatch({error, {badarg, _}}, jsone_decode:decode(<<"1e999">>)),  % exponent out of range
               ?assertMatch({error, {badarg, _}}, jsone_decode:decode(<<"1e999">>)),  % exponent out of range

+ 1 - 1
test/jsone_encode_tests.erl

@@ -106,7 +106,7 @@ encode_test_() ->
               Expected22 = <<$", Input2/binary, $">>,
               Expected22 = <<$", Input2/binary, $">>,
               ?assertEqual({ok, Expected22}, jsone_encode:encode(Input2, [native_utf8]))
               ?assertEqual({ok, Expected22}, jsone_encode:encode(Input2, [native_utf8]))
       end},
       end},
-     {"string: containts surrogate pairs",
+     {"string: contains surrogate pairs",
       fun () ->
       fun () ->
               Input = <<"𢁉𢂚𢃼">>,
               Input = <<"𢁉𢂚𢃼">>,
               Expected = <<"\"\\ud848\\udc49\\ud848\\udc9a\\ud848\\udcfc\"">>,
               Expected = <<"\"\\ud848\\udc49\\ud848\\udc9a\\ud848\\udcfc\"">>,