-
Notifications
You must be signed in to change notification settings - Fork 0
/
Driver.java
29 lines (24 loc) · 887 Bytes
/
Driver.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
public class Driver{
public static void main(String[]args){
//Variables of the test cases are pre-declared.
//This allows you to copy/paste the entire test case and just change the variables.
String a;
String b;
String whole;
String part;
String number;
//Single test case myCompareTo:
a="cat";
b="dog";
System.out.println("Expected same sign: "+ a.compareTo(b) +" vs my function: "+StringMethods.myCompareTo(a,b));
//Single test case myIndexOf:
whole = "Hello";
part = "He";
System.out.println("Expected "+ whole.indexOf(part) +" vs my function: "+ "REPLACE THIS WITH YOUR myIndexOf CALL" );
//Single test case parseInt:
number = "152";
int actual = Integer.parseInt(number);
int guess = -9999999;//replace with your parse function
System.out.println("Expected "+ actual +" vs my function: "+ guess+" "+(actual==guess));
}
}