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

not return error when unmarshalling INF-like string #90

Closed
liuq19 opened this issue Sep 8, 2021 · 1 comment
Closed

not return error when unmarshalling INF-like string #90

liuq19 opened this issue Sep 8, 2021 · 1 comment

Comments

@liuq19
Copy link
Collaborator

liuq19 commented Sep 8, 2021

Sonic does not return the error when unmarshalling an INF-like string, as 9e370.

func TestUnmarshalINF(t *testing.T) {
	var v interface{}
	data := []byte("9e370")   // INF
	sonicerr := sonic.Unmarshal(data, &v)
	stderr := json.Unmarshal(data, &v)
	if sonicerr == nil && stderr != nil {
		t.Errorf("should have unmarshal error like %#v\n", stderr)
	}
}
@liuq19
Copy link
Collaborator Author

liuq19 commented Sep 14, 2021

#97

@liuq19 liuq19 closed this as completed Sep 14, 2021
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

1 participant