Exemplo n.º 1
0
def test_t3():
    formatString = 'i8x1,i16x2,i32x3,i64x4,ui8x5,ui16x6,ui32x7,ui64x8,f32x9,f64x10'
    predict = [
        {
            'type': 0,
            'num': 1
        },
        {
            'type': 1,
            'num': 2
        },
        {
            'type': 2,
            'num': 3
        },
        {
            'type': 3,
            'num': 4
        },
        {
            'type': 4,
            'num': 5
        },
        {
            'type': 5,
            'num': 6
        },
        {
            'type': 6,
            'num': 7
        },
        {
            'type': 7,
            'num': 8
        },
        {
            'type': 8,
            'num': 9
        },
        {
            'type': 9,
            'num': 10
        },
    ]

    res = getStTypeList(formatString)
    assert res == predict
Exemplo n.º 2
0
def test_f4():
    formatString = 'ui8x1,'
    predict = None

    res = getStTypeList(formatString)
    assert res == predict
Exemplo n.º 3
0
def test_t1():
    formatString = 'ui8x10'
    predict = [{'type': 4, 'num': 10}]

    res = getStTypeList(formatString)
    assert res == predict
Exemplo n.º 4
0
def test_t2():
    formatString = 'ui8x10000,f32x1'
    predict = [{'type': 4, 'num': 10000}, {'type': 8, 'num': 1}]

    res = getStTypeList(formatString)
    assert res == predict
Exemplo n.º 5
0
def test_f6():
    formatString = '1x1'
    predict = None

    res = getStTypeList(formatString)
    assert res == predict