// Path: javagit/src/main/java/edu/nyu/cs/javagit/utilities/StringUtilities.java
// public final class StringUtilities {
//     /**
//      * Returns the position for char 'c' in string 'str' starting from position 'pos'
//      * and searching towards the string beginning
//      * @param str
//      * @param from
//      * @param c
//      * @return char 'c' position or -1 if char is not found
//      */
//     public static int indexOfLeft(String str, int from, char c) {
//         int pos = -1;
//         int f = from;
// 
//         while(  f >= 0 && pos == -1 )
//             if ( str.charAt(f--) == c )
//                 pos = f+1;
// 
//         return pos;
//     }
// }


import edu.nyu.cs.javagit.utilities.StringUtilities;
import junit.framework.TestCase;
import org.junit.Test;
package edu.nyu.cs.javagit.test.utilities;


/**
 * Description : StringUtilities testing
 * Date: 3/31/13
 * Time: 7:16 PM
 */
public class TestStringUtilities extends TestCase {
    @Test
    public void testFindChar() {
        String str = "aaaaaaa bbb cccc";
// Path: javagit/src/main/java/edu/nyu/cs/javagit/utilities/StringUtilities.java
// public final class StringUtilities {
//     /**
//      * Returns the position for char 'c' in string 'str' starting from position 'pos'
//      * and searching towards the string beginning
//      * @param str
//      * @param from
//      * @param c
//      * @return char 'c' position or -1 if char is not found
//      */
//     public static int indexOfLeft(String str, int from, char c) {
//         int pos = -1;
//         int f = from;
// 
//         while(  f >= 0 && pos == -1 )
//             if ( str.charAt(f--) == c )
//                 pos = f+1;
// 
//         return pos;
//     }
// }


// Path: javagit/src/test/java/edu/nyu/cs/javagit/test/utilities/TestStringUtilities.java
import edu.nyu.cs.javagit.utilities.StringUtilities;
import junit.framework.TestCase;
import org.junit.Test;

package edu.nyu.cs.javagit.test.utilities;


/**
 * Description : StringUtilities testing
 * Date: 3/31/13
 * Time: 7:16 PM
 */
public class TestStringUtilities extends TestCase {
    @Test
    public void testFindChar() {
        String str = "aaaaaaa bbb cccc";
        assertEquals(11, StringUtilities.indexOfLeft(str, 13, ' '));