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

perf: used hash object confirm if there was a duplicated value in array. #21

Merged
merged 1 commit into from
Jul 17, 2020

Conversation

membphis
Copy link
Contributor

No description provided.

@membphis
Copy link
Contributor Author

the output of the test case at my local machine.

$ make test
LUA_PATH="./lib/?.lua;./deps/lib/lua/5.1/?.lua;./deps/share/lua/5.1/?.lua;;" LUA_CPATH="./deps/lib/lua/5.1/?.so;;" resty t/draft4.lua
skip suite case: [object type matches objects] -> [an array is not an object]
skip suite case: [array type matches arrays] -> [an object is not an array]
skip suite case: [required validation] -> [ignores arrays]
skip suite case: [regexes are not anchored by default and are case sensitive] -> [recognized members are accounted for]
skip suite case: [minProperties validation] -> [ignores arrays]
skip suite case: [exclusiveMinimum validation] -> [above the minimum is still valid]
skip suite case: [exclusiveMinimum validation] -> [boundary point is invalid]
skip suite case: [exclusiveMaximum validation] -> [below the maximum is still valid]
skip suite case: [exclusiveMaximum validation] -> [boundary point is invalid]
testcases loaded: 0.012106969
validate res: true err:
case: {"valid":false,"data":[{"foo":"bar"},{"foo":"bar"}],"description":"non-unique array of objects is invalid"} suite: uniqueItems validation
validate res: true err:
case: {"valid":false,"data":[{"foo":{"bar":{"baz":true}}},{"foo":{"bar":{"baz":true}}}],"description":"non-unique array of nested objects is invalid"} suite: uniqueItems validation
validate res: true err:
case: {"valid":false,"data":[["foo"],["foo"]],"description":"non-unique array of arrays is invalid"} suite: uniqueItems validation
validate res: true err:
case: {"valid":false,"data":[{},[1],true,null,{},1],"description":"non-unique heterogeneous types are invalid"} suite: uniqueItems validation
validations: 0.001885433
LUA_PATH="./lib/?.lua;./deps/lib/lua/5.1/?.lua;./deps/share/lua/5.1/?.lua;;" LUA_CPATH="./deps/lib/lua/5.1/?.so;;" resty t/draft6.lua
skip suite case: [object type matches objects] -> [an array is not an object]
skip suite case: [array type matches arrays] -> [an object is not an array]
skip suite case: [required validation] -> [ignores arrays]
skip suite case: [regexes are not anchored by default and are case sensitive] -> [recognized members are accounted for]
skip suite case: [minProperties validation] -> [ignores arrays]
skip suite case: [propertyNames validation] -> [some property names invalid]
skip suite case: [contains keyword validation] -> [not array is valid]
testcases loaded: 0.016585623
validate res: true err:
case: {"valid":false,"data":[{"foo":"bar"},{"foo":"bar"}],"description":"non-unique array of objects is invalid"} suite: uniqueItems validation
validate res: true err:
case: {"valid":false,"data":[{"foo":{"bar":{"baz":true}}},{"foo":{"bar":{"baz":true}}}],"description":"non-unique array of nested objects is invalid"} suite: uniqueItems validation
validate res: true err:
case: {"valid":false,"data":[["foo"],["foo"]],"description":"non-unique array of arrays is invalid"} suite: uniqueItems validation
validate res: true err:
case: {"valid":false,"data":[{},[1],true,null,{},1],"description":"non-unique heterogeneous types are invalid"} suite: uniqueItems validation
validations: 0.00232468
LUA_PATH="./lib/?.lua;./deps/lib/lua/5.1/?.lua;./deps/share/lua/5.1/?.lua;;" LUA_CPATH="./deps/lib/lua/5.1/?.so;;" resty t/draft7.lua
skip suite case: [object type matches objects] -> [an array is not an object]
skip suite case: [array type matches arrays] -> [an object is not an array]
skip suite case: [required validation] -> [ignores arrays]
skip suite case: [regexes are not anchored by default and are case sensitive] -> [recognized members are accounted for]
skip suite case: [minProperties validation] -> [ignores arrays]
skip suite case: [propertyNames validation] -> [some property names invalid]
skip suite case: [contains keyword validation] -> [not array is valid]
testcases loaded: 0.014141289
validate res: true err:
case: {"valid":false,"data":[{"foo":"bar"},{"foo":"bar"}],"description":"non-unique array of objects is invalid"} suite: uniqueItems validation
validate res: true err:
case: {"valid":false,"data":[{"foo":{"bar":{"baz":true}}},{"foo":{"bar":{"baz":true}}}],"description":"non-unique array of nested objects is invalid"} suite: uniqueItems validation
validate res: true err:
case: {"valid":false,"data":[["foo"],["foo"]],"description":"non-unique array of arrays is invalid"} suite: uniqueItems validation
validate res: true err:
case: {"valid":false,"data":[{},[1],true,null,{},1],"description":"non-unique heterogeneous types are invalid"} suite: uniqueItems validation
validations: 0.002209948
LUA_PATH="./lib/?.lua;./deps/lib/lua/5.1/?.lua;./deps/share/lua/5.1/?.lua;;" LUA_CPATH="./deps/lib/lua/5.1/?.so;;" resty t/default.lua
passed: table value as default value
passed: check uniqueItems array

@membphis membphis merged commit 335a7fa into master Jul 17, 2020
@membphis
Copy link
Contributor Author

fixed #20

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

Successfully merging this pull request may close these issues.

1 participant