Also naming fix, buildin => builtin. Removes the use of ConstantStaticArray, as this was context dependent
21 lines
511 B
Python
21 lines
511 B
Python
import pytest
|
|
|
|
from phasm import typing as sut
|
|
|
|
class TestTypeConstraintBitWidth:
|
|
@pytest.mark.parametrize('oneof,exp', [
|
|
(set(), '', ),
|
|
({1}, '1', ),
|
|
({1,2}, '1,2', ),
|
|
({1,2,3}, '1..3', ),
|
|
({1,2,3,4}, '1..4', ),
|
|
|
|
({1,3}, '1,3', ),
|
|
({1,4}, '1,4', ),
|
|
|
|
({1,2,3,4,6,7,8,9}, '1..4,6..9', ),
|
|
])
|
|
def test_repr(self, oneof, exp):
|
|
mut_self = sut.TypeConstraintBitWidth(oneof=oneof)
|
|
assert ('BitWidth=' + exp) == repr(mut_self)
|