tests for ternary comparisons