test for terminalindex