-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from LoiNguyenCS/add-resolve
Fix bugs with array type
- Loading branch information
Showing
4 changed files
with
43 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/test/java/org/checkerframework/specimin/ArrayTypeTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package org.checkerframework.specimin; | ||
|
||
import java.io.IOException; | ||
import org.junit.Test; | ||
|
||
/** | ||
* This test checks if Specimin will work for array types | ||
*/ | ||
public class ArrayTypeTest { | ||
@Test | ||
public void runTest() throws IOException { | ||
SpeciminTestExecutor.runTestWithoutJarPaths( | ||
"arrayType", | ||
new String[] {"com/example/Simple.java"}, | ||
new String[] {"com.example.Simple#sortArray(int[])"}); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/test/resources/arrayType/expected/com/example/Simple.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.example; | ||
|
||
import java.util.Arrays; | ||
|
||
class Simple { | ||
|
||
public static int[] sortArray(int[] array) { | ||
Arrays.sort(array); | ||
return array; | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/test/resources/arrayType/input/com/example/Simple.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.example; | ||
|
||
import java.util.Arrays; | ||
|
||
class Simple { | ||
// Target method. | ||
public static int[] sortArray(int[] array) { | ||
Arrays.sort(array); | ||
return array; | ||
} | ||
} |