<gh_stars>0
#!/usr/bin/env python3

import unittest
from itertools import combinations
from parameterized import parameterized_class
from lcarmq import Bfc2000
import numpy as np
from lcarmq.utils import random_pmarray

@parameterized_class([
    {"size": 100},
    {"size": 200},
    {"size": 300},
])
class TestRMQBFC2000(unittest.TestCase):

    def test_pmrmq(self):
        array = random_pmarray(size=self.size, seed=0)
        rmq = Bfc2000(array, validate_input=True)
        for l, r in combinations(range(len(array)), 2):
            self.assertEqual(array[rmq.query(l, r)],
                             min(array[l:r+1]))

    def test_notpmarray(self):
        arr = [1,2,4,6]
        self.assertRaises(TypeError, Bfc2000, arr, validate_input=True)

    def test_validation(self):
        arr = [1,2,3,4.0]
        self.assertRaises(TypeError, Bfc2000, arr, validate_input=True)


if __name__ == "__main__":
    unittest.main()

#!/usr/bin/env python3

import unittest
from itertools import combinations
from parameterized import parameterized_class
from lcarmq import Bfc2000
import numpy as np
from lcarmq.utils import random_pmarray

@parameterized_class([
    {"size": 100},
    {"size": 200},
    {"size": 300},
])
class TestRMQBFC2000(unittest.TestCase):

    def test_pmrmq(self):
        array = random_pmarray(size=self.size, seed=0)
        rmq = Bfc2000(array, validate_input=True)
        for l, r in combinations(range(len(array)), 2):
            self.assertEqual(array[rmq.query(l, r)],
                             min(array[l:r+1]))

    def test_notpmarray(self):
        arr = [1,2,4,6]
        self.assertRaises(TypeError, Bfc2000, arr, validate_input=True)

    def test_validation(self):
        arr = [1,2,3,4.0]
        self.assertRaises(TypeError, Bfc2000, arr, validate_input=True)


if __name__ == "__main__":
    unittest.main()
#!/usr/bin/env python3