def test_intarray():
    testcase = sealapi.Plaintext('3x^3 + 1x^1 + 3')
    int_arr = testcase.dyn_array()
    assert (int_arr[0] == 3)
    assert (int_arr.at(3) == 3)
    assert (int_arr.empty() is False)
    assert (int_arr.max_size() == ((2 ** 64) - 1))
    assert (int_arr.size() == 4)
    assert (int_arr.capacity() == 4)

    def save_load(path):
        int_arr.save(path)
        save_test = sealapi.DynArray()
        save_test.load(path)
        assert (save_test[0] == 3)
    tmp_file(save_load)
    int_arr.resize(10, True)
    assert (int_arr.capacity() == 10)
    assert (int_arr.size() == 10)
    int_arr.reserve(30)
    assert (int_arr.capacity() == 30)
    assert (int_arr.capacity() == 30)
    int_arr.shrink_to_fit()
    assert (int_arr.capacity() == 10)
    assert (int_arr.size() == 10)
    int_arr.clear()
    assert (int_arr.size() == 0)
    assert (int_arr.capacity() == 10)
    assert (int_arr.empty() is True)
    int_arr.release()
    assert (int_arr.capacity() == 0)
def test_intarray():
    testcase = sealapi.Plaintext('3x^3 + 1x^1 + 3')
    int_arr = testcase.dyn_array()
    assert (int_arr[0] == 3)
    assert (int_arr.at(3) == 3)
    assert (int_arr.empty() is False)
    assert (int_arr.max_size() == ((2 ** 64) - 1))
    assert (int_arr.size() == 4)
    assert (int_arr.capacity() == 4)

    def save_load(path):
        int_arr.save(path)
        save_test = sealapi.DynArray()
        save_test.load(path)
        assert (save_test[0] == 3)
    tmp_file(save_load)
    int_arr.resize(10, True)
    assert (int_arr.capacity() == 10)
    assert (int_arr.size() == 10)
    int_arr.reserve(30)
    assert (int_arr.capacity() == 30)
    assert (int_arr.capacity() == 30)
    int_arr.shrink_to_fit()
    assert (int_arr.capacity() == 10)
    assert (int_arr.size() == 10)
    int_arr.clear()
    assert (int_arr.size() == 0)
    assert (int_arr.capacity() == 10)
    assert (int_arr.empty() is True)
    int_arr.release()
    assert (int_arr.capacity() == 0)