package edu.grinnell.csc207.username.utils;

import static org.junit.Assert.*;

public class StringUtilsTest
{

  @Test
  public void
    test1 ()
  {
    assertArrayEquals (new String[] { "a", "b", "c" },
                       StringUtils.splitAt ("a:b:c", ':'));
  }
    @Test
    public void
      test2 ()
    {
    assertArrayEquals (new String[] { "a", "b", "c" },
                       StringUtils.splitAt ("a b c", ' '));
    }
    @Test
    public void
      test3 ()
    {
    assertArrayEquals (new String[] { "a:b:c" },
                       StringUtils.splitAt ("a:b:c", ' '));
    }
    @Test
    public void
      test4 ()
    {
    assertArrayEquals ("one field", new String[] { "a" },
                       StringUtils.splitAt ("a", ':'));
    }
    @Test
    public void
      test5 ()
    {
    assertArrayEquals ("empty inner field", new String[] { "a", "", "c" },
                       StringUtils.splitAt ("a::c", ':'));
    }
    @Test
    public void
      test6 ()
    {
    assertArrayEquals ("leading empty field", new String[] { "", "a" },
                       StringUtils.splitAt (":a", ':'));
    }
    @Test
    public void
      test7 ()
    {
    assertArrayEquals ("trailing empty field", new String[] { "a", "" },
                       StringUtils.splitAt ("a:", ':'));
    }
    
    @Test
    public void
      test8 () 
    {
  assertEquals ("e", StringUtils.deLeet ("3"));
    }
    @Test
    public void
      test9 ()
    {
  assertEquals ("leet", StringUtils.deLeet ("133+"));
    }
    @Test
    public void
      test10 ()
    {
  assertEquals ("eat banana", StringUtils.deLeet ("3@+ |3@|\\|@|\\|@"));
    }
    @Test
    public void
      test11 ()
    {
    assertEquals (BigInteger.valueOf (0), Calculator.eval0 ("0"));
    assertEquals (BigInteger.valueOf (2), Calculator.eval0 ("1 + 1"));
    assertEquals (BigInteger.valueOf (4), Calculator.eval0 ("1 + 2 + 1"));
    assertEquals (BigInteger.valueOf (9), Calculator.eval0 ("1 + 2 * 3"));
    }
}



@@ -1995,12 +1995,413 @@
 ;%0A    %7D%0A
+    @Test%0A    public void%0A      test12 ()%0A    %7B%0A    assertArrayEquals (new String%5B%5D %7B %22a%22, %22b%22, %22c%22 %7D,%0A                       StringUtils.splitCSV(%22a,b,c%22));%0A    assertArrayEquals (new String%5B%5D %7B %22a,b%22, %22c%22 %7D,%0A                       StringUtils.splitCSV(%22%5C%22a,b%5C%22,c%22));%0A    assertArrayEquals (new String%5B%5D %7B %22a%22, %22b,b%5C%22%22, %22c%22 %7D,%0A                       StringUtils.splitCSV(%22a,%5C%22b,b%5C%22%5C%22%5C%22,c%22));%0A      %7D%0A
 %7D%0A%0A%0A

Update StringUtilsTest.java