I think there should be exists ...
Perlover opened this issue · 1 comments
Perlover commented
Hi,
I see now test file:
http-browserdetect/t/01-detect.t
Line 46 in 03f0c76
I think there should be like:
if ( exists $test->{$method} ) {
I think same because useragents.json has lines like:
"country" : null,
"language" : null,
For example if module returns $detect->language
as "EN" but in useragents.json
there will be "language": null
now your tests will be successfully. But i think should be fail because $detect->language
exists and returns "EN" for example.
If i will comment like same lines your tests will sucessfully but i think you wanted to chech that methos exists and returns undef
But if i change to exists
many tests fails like this:
# Failed test 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; GTB6.6; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; AskTbBLT/5.12.1.16460)'
# at t/01-detect.t line 125.
# Failed test 'robot: 0'
# at t/01-detect.t line 46.
# got: ''
# expected: '0'
# Looks like you failed 1 test of 34.
What do you think about this?