def test_all_basetypes():
    grammar = """
        Rule:
            a=FLOAT
            b=INT
            c1=BOOL
            c2=BOOL
            d1=STRING
            d2=STRING
            e=ID
        ;
    """
    meta = metamodel_from_str(grammar)
    assert meta
    assert meta['Rule']._tx_type is RULE_COMMON
    assert meta['BASETYPE']._tx_type is RULE_MATCH
    assert meta['NUMBER']._tx_type is RULE_MATCH
    assert meta['INT']._tx_type is RULE_MATCH
    assert meta['FLOAT']._tx_type is RULE_MATCH
    assert meta['STRING']._tx_type is RULE_MATCH
    assert meta['BOOL']._tx_type is RULE_MATCH

    model = meta.model_from_str('3.4 5 true 0 "some string" '
                                '\'some other string\' some_id')
    assert model.a == 3.4
    assert model.b == 5
    assert model.c1 is True
    assert model.c2 is False
    assert model.d1 == "some string"
    assert model.d2 == "some other string"
    assert model.e == "some_id"
Test that base types are matched properly.
dataset/ETHPy150Open igordejanovic/textX/tests/functional/test_textx_language.py/test_all_basetypes