File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -251,6 +251,32 @@ def test_empty_prefix(self):
251
251
g2
252
252
), "Document with declared empty prefix must match default #"
253
253
254
+ def test_float_no_norm (self ):
255
+ import rdflib
256
+ _ps = rdflib .NORMALIZE_LITERALS
257
+ try :
258
+ bads = []
259
+ for norm_lit in (True , False ):
260
+ rdflib .NORMALIZE_LITERALS = norm_lit
261
+ g1 = Graph ()
262
+ g1 .parse (data = ":a :b 1e10, 1e0 ." , format = "n3" )
263
+ strep = [str (o ) for o in g1 .objects ()]
264
+ if norm_lit :
265
+ if '1e10' not in strep and '1e0' not in strep :
266
+ pass
267
+ else :
268
+ bads .append (('NOT normalized when should have been' , strep ))
269
+ else :
270
+ if '1e10' in strep and '1e0' in strep :
271
+ pass
272
+ else :
273
+ bads .append (('normalized when it should NOT have been' , strep ))
274
+
275
+ finally :
276
+ rdflib .NORMALIZE_LITERALS = _ps
277
+
278
+ assert not bads , bads
279
+
254
280
255
281
class TestRegularExpressions :
256
282
def test_exponents (self ):
You can’t perform that action at this time.
0 commit comments