'Short-circuit'에 해당되는 글 1건
- 2010.12.20 Short-circuit 확인 테스트 코드
- Short-circuit 확인 테스트 코드
- 日常茶飯事
- 2010. 12. 20. 06:30
private String s; @Test(expected = NullPointerException.class) public void testShortCircuit1(){ assertFalse((s != null) & (s.length() > 0)); } @Test public void testShortCircuit2(){ assertFalse((s != null) && (s.length() > 0)); } @Test(expected = NullPointerException.class) public void testShortCircuit3(){ assertFalse((s == null) | (s.length() == 0)); } @Test public void testShortCircuit4(){ assertTrue((s == null) || (s.length() == 0)); }
Recent comment