Verified Commit f967bdb7 authored by Carlos Galindo's avatar Carlos Galindo
Browse files

Add test cases and their initial reference answer

parent af492b3f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -71,7 +71,7 @@ public class SlicerTest {
            return;
        Slice slice = slice(source ,sc);
        boolean equal = slicesMatch(slice, target);
        assert equal: "The slice for " + source.toString() + " has change, please fix the error or update the reference slice.";
        assert equal: "The slice for " + source.toString() + " has changed, please fix the error or update the reference slice.";
    }

    @Test
+3 −1
Original line number Diff line number Diff line
import java.util.Scanner;

public class Classic {
    public static void main(String[] args) {
        int sum = 0;
@@ -18,7 +20,7 @@ public class Classic {
        int chars = 1;
        String subtext = "";
        int i = 0;
        while (i < text.size()) {
        while (i < text.length()) {
            char c = text.charAt(i);
            if (c == '\n') {
                lines += 1;
+1 −0
Original line number Diff line number Diff line
13
+12 −0
Original line number Diff line number Diff line
import java.util.Scanner;

public class Classic {

    public static void main(String[] args) {
        int product = 1;
        for (int i = 1; i < N; i++) {
            product *= i;
        }
        System.out.println(product);
    }
}
+5 −5
Original line number Diff line number Diff line
@@ -3,14 +3,14 @@ public class Problem1 {
        while (X) {
            if (Y) {
                if (Z) {
                    A();
                    System.out.println("A");
                    break;
                }
                B();
                System.out.println("B");
                break;
            }
            C();
            System.out.println("C");
        }
        D();
        System.out.println("D");
    }
}
Loading