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

tests/httpd/scripts/number-comparison test is failing #129

Open
ssssam opened this issue Aug 22, 2015 · 2 comments
Open

tests/httpd/scripts/number-comparison test is failing #129

ssssam opened this issue Aug 22, 2015 · 2 comments

Comments

@ssssam
Copy link

ssssam commented Aug 22, 2015

Hi!
First, thanks for releasing 4Store, it looks really useful. I'm just getting started with it myself!
I noticed that when I run make test in 'master' (commit 1b31202) the number-comparison test fails.

This is the diff created by run.pl --outdir out scripts/number-comparsion:

10,11d9
< -2.500001
< -2.500001e0
13c11,12
< "-2.5"^^<http://www.w3.org/2001/XMLSchema#float>

---
> -2.500001e0
> -2.500001
15a15
> "-2.5"^^<http://www.w3.org/2001/XMLSchema#float>
17d16
< -2.499999e0
18a18
> -2.499999e0
22,23d21
< 0
< +0
24a23,24
> +0
> 0
31d30
< 2.5e0
32a32
> 2.5e0
36d35
< 1234
37a37
> 1234
44d43
< "+23.0e999999999999999999999999"^^<http://www.w3.org/2001/XMLSchema#float>
45a45
> "+23.0e999999999999999999999999"^^<http://www.w3.org/2001/XMLSchema#float>
53,54d52
< -2.500001
< -2.500001e0
55a54,55
> -2.500001e0
> -2.500001
59d58
< -2.499999e0
60a60
> -2.499999e0
62,63d61
< 0
< +0
64a63,64
> +0
> 0
71d70
< 2.5e0
72a72
> 2.5e0
76d75
< 1234
77a77
> 1234
84d83
< "+23.0e999999999999999999999999"^^<http://www.w3.org/2001/XMLSchema#float>
85a85
> "+23.0e999999999999999999999999"^^<http://www.w3.org/2001/XMLSchema#float>
88,89d87
< -2.500001
< -2.500001e0
91c89,90
< "-2.5"^^<http://www.w3.org/2001/XMLSchema#float>

---
> -2.500001e0
> -2.500001
93a93
> "-2.5"^^<http://www.w3.org/2001/XMLSchema#float>
95d94
< -2.499999e0
96a96
> -2.499999e0
@ssssam
Copy link
Author

ssssam commented Aug 22, 2015

Looking at it closely, it seems like there aren't actually actual numerical errors going on, it's just that the ordering of different types has changed.

For example, for this query: BASE <http://example.com/> SELECT ?o WHERE { GRAPH <http://example.com/numbers.ttl> { ?s <test:num> ?o . FILTER (?o < -2) . }} ORDER BY ?o

Expected result includes:

-2.500001                                              
-2.500001e0                                            
"-2.500001"^^<http://www.w3.org/2001/XMLSchema#float> 
"-2.5"^^<http://www.w3.org/2001/XMLSchema#float>      
-2.5                                                  
-2.5e0                                                
-2.499999                                             
-2.499999e0                                           
"-2.499999"^^<http://www.w3.org/2001/XMLSchema#float> 
-2.00050000                                           

Actual result includes:

"-2.500001"^^<http://www.w3.org/2001/XMLSchema#float>  
-2.500001e0
-2.500001
-2.5
-2.5e0
"-2.5"^^<http://www.w3.org/2001/XMLSchema#float>
-2.499999                                              
"-2.499999"^^<http://www.w3.org/2001/XMLSchema#float>  
-2.499999e0                                            
-2.00050000

The numbers are still in the right order, but the string cast to a float is now sorted before the float, instead of after it. The other errors seem to be similar things.

@swh
Copy link
Collaborator

swh commented Aug 23, 2015

Odd - I can't think of any reason why the ordering would have changed...

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