Changeset - d1946cb32121
[Not reviewed]
default
0 2 0
drewp@bigasterisk.com - 8 months ago 2024-05-28 22:34:21
drewp@bigasterisk.com
bool support
2 files changed with 6 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/light9/typedgraph.py
Show inline comments
 
@@ -44,6 +44,7 @@ def _convLiteral(objType: Type[_ObjType]
 
    for outType, dtypes in [
 
        (float, (XSD['integer'], XSD['double'], XSD['decimal'])),
 
        (int, (XSD['integer'],)),
 
        (bool, (XSD['boolean'],)), # todo tests
 
        (str, ()),
 
    ]:
 
        for t in _expandUnion(objType):
src/light9/typedgraph_test.py
Show inline comments
 
@@ -19,6 +19,8 @@ g = cast(
 
        :float1 0.0;
 
        :float2 1.0e1;
 
        :float3 0.5;
 
        :boolt true;
 
        :boolf false;
 
        :color "#ffffff"^^:hexColor;
 
        :definitelyAString "hello" .
 
'''))
 
@@ -89,6 +91,9 @@ class TestTypedValueReturnsBasicTypes:
 
        assert type(tv) == Literal
 
        assert tv.datatype == L9['hexColor']
 

	
 
    def test_getsBoolean(self):
 
        assert typedValue(bool, g, subj, L9['boolt'])
 
        assert not typedValue(bool, g, subj, L9['boolf'])
 

	
 
class TestTypedValueDoesntDoInappropriateUriStringConversions:
 

	
0 comments (0 inline, 0 general)