Skip to content
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

lept_parse函数中在处理后续的空白时应该加上 v->type = LEPT_NULL; #11

Closed
j178 opened this issue Sep 19, 2016 · 2 comments
Closed

Comments

@j178
Copy link

j178 commented Sep 19, 2016

if (*c.json != '\0') {
            v->type = LEPT_NULL;  //应该加上这一行
            ret = LEPT_PARSE_ROOT_NOT_SINGULAR;
        }

因为在test_parse_root_not_singular()函数中测试的刚好是

EXPECT_EQ_INT(LEPT_PARSE_ROOT_NOT_SINGULAR, lept_parse(&v, "null x"));

所以如果解析错误了, 后续的

EXPECT_EQ_INT(LEPT_NULL, lept_get_type(&v));

测试还是可以通过, 如果增加新的测试, 比如

EXPECT_EQ_INT(LEPT_PARSE_ROOT_NOT_SINGULAR, lept_parse(&v, "false a"));

就无法通过了.

@j178
Copy link
Author

j178 commented Sep 19, 2016

刚看了第二章, 发现改了:smile:, 求关闭

@j178 j178 closed this as completed Sep 19, 2016
@miloyip
Copy link
Owner

miloyip commented Sep 19, 2016

之前的确是少写了。多谢反馈。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants