Commits

Tim Vernum  committed 485568e

Add new functional test

  • Participants
  • Parent commits e0f9917

Comments (0)

Files changed (4)

File convert/source/java/main/org/adjective/syntactic/convert/j8to7/Convert8To7Visitor.java

 
     public void convert(final ASTCompilationUnit tree)
     {
+        if (tree == null)
+        {
+            throw new IllegalArgumentException("No AST supplied");
+        }
         tree.jjtAccept(this, null);
     }
 

File convert/source/java/test/org/adjective/syntactic/convert/j8to7/functional/ConvertFunctionalTest.java

     private void convertAndVerify(final File input, final File expected) throws IOException
     {
         final ASTCompilationUnit ast = JavaParser.process(input);
+        if (ast == null)
+        {
+            Assert.fail("Failed to parse " + input);
+        }
         if (!expected.exists())
         {
             System.err.println("Output '" + expected.getAbsolutePath() + "' for '" + input + "' does not exist");

File convert/source/resource/test/functional/003-ParameterTypesAndNames.java

+package com.example;
+
+import java.util.Comparator;
+
+public class Main
+{
+    public static void main(String[] args)
+    {
+        Comparator<? super Double> cmp = (Number a, Number b) -> a.compareTo(b);
+    } 
+}
+

File convert/source/resource/test/functional/003-ParameterTypesAndNames.java.convert

+package com.example;
+import java.util.Comparator;
+public class Main {
+  public static void main(String[] args) {
+    Comparator<? super Double> cmp = new Comparator<Number>() {
+      public int compare(Number a, Number b) {
+        return a.compareTo(b);
+      }
+    }
+;
+  }
+}