Beispiel #1
0
 public void testOct() {
   assertEquals("0", Vba.oct(0));
   assertEquals("1", Vba.oct(1));
   assertEquals("12", Vba.oct(10));
   assertEquals("144", Vba.oct(100));
   assertEquals("37777777777", Vba.oct(-1));
   assertEquals("37777777766", Vba.oct(-10));
   assertEquals("37777777634", Vba.oct(-100));
   try {
     Object o = Vba.oct("a");
     fail("expected error, got " + o);
   } catch (RuntimeException e) {
     assertMessage(e, "Invalid parameter.");
   }
 }
Beispiel #2
0
 public void testStr() {
   assertEquals(" 0", Vba.str(0));
   assertEquals(" 1", Vba.str(1));
   assertEquals(" 10", Vba.str(10));
   assertEquals(" 100", Vba.str(100));
   assertEquals("-1", Vba.str(-1));
   assertEquals("-10", Vba.str(-10));
   assertEquals("-100", Vba.str(-100));
   assertEquals("-10.123", Vba.str(-10.123));
   assertEquals(" 10.123", Vba.str(10.123));
   try {
     Object o = Vba.oct("a");
     fail("expected error, got " + o);
   } catch (RuntimeException e) {
     assertMessage(e, "Invalid parameter.");
   }
 }