def test_truncate_function(self):
        self.assertEqual(pyrtl.truncate(5, 3), 5)
        self.assertEqual(pyrtl.truncate(9, 3), 1)
        self.assertEqual(pyrtl.truncate(-1, 3), 7)
        with self.assertRaises(pyrtl.PyrtlError):
            pyrtl.truncate(5, -1)
        with self.assertRaises(pyrtl.PyrtlError):
            pyrtl.truncate(29, 0)