add test for correct boundary handling

A test for proper handling of the constant boundary. This will fail with a segfault if the read is done without checking the bounds first.