Skip to content

Commit 0a773d1

Browse files
committed
Release project version v1.0.2
2 parents a5e5fc4 + e8fe257 commit 0a773d1

File tree

5 files changed

+44
-43
lines changed

5 files changed

+44
-43
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ plugins {
2424
apply from: "https://gist.githubusercontent.com/raw/$spotlessRulesGistId/spotless.gradle"
2525

2626
group 'io.yooksi'
27-
version '1.0.1'
27+
version '1.0.2'
2828

2929
idea {
3030
project {

src/main/java/io/yooksi/pz/zdoc/element/LuaMethod.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
/**
2929
* This class represents a parsed Lua method.
3030
*/
31+
@SuppressWarnings("unused")
3132
public class LuaMethod extends Method {
3233

3334
private final String qualifier;
@@ -78,7 +79,7 @@ public String toString() {
7879
sb.append("function ");
7980

8081
if (!qualifier.isEmpty()) {
81-
sb.append(qualifier).append('.');
82+
sb.append(qualifier).append(':');
8283
}
8384
sb.append(name).append('(');
8485

src/test/java/io/yooksi/pz/zdoc/MainTest.java

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,33 @@ public class MainTest extends TestWorkspace {
4141
super("sampleLua.lua");
4242
}
4343

44+
private static Executable runMain(@Nullable Command command, String input, String output) {
45+
return () -> Main.main(formatAppArgs(command != null ? command.getName() : "", input, output));
46+
}
47+
48+
@TestOnly
49+
public static String[] formatAppArgs(String command, String input, String output) {
50+
51+
List<String> args = new java.util.ArrayList<>();
52+
args.add(command);
53+
if (!input.isEmpty())
54+
{
55+
args.add("-i");
56+
args.add(input);
57+
}
58+
if (!output.isEmpty())
59+
{
60+
args.add("-o");
61+
args.add(output);
62+
}
63+
return args.toArray(new String[]{});
64+
}
65+
66+
@TestOnly
67+
public static String[] formatAppArgs(Command command, String input, String output) {
68+
return formatAppArgs(command.getName(), input, output);
69+
}
70+
4471
@Test
4572
void shouldThrowExceptionWhenApplicationRunWithMissingCommand() {
4673

@@ -155,32 +182,4 @@ void whenApplicationRunShouldConvertJavaToLuaDoc() throws Throwable {
155182
Assertions.assertEquals(expected[i], actual.get(i));
156183
}
157184
}
158-
159-
private static Executable runMain(@Nullable Command command, String input, String output) {
160-
return () -> Main.main(formatAppArgs(command != null ? command.getName() : "", input, output));
161-
}
162-
163-
@TestOnly
164-
public static String[] formatAppArgs(String command, String input, String output) {
165-
166-
List<String> args = new java.util.ArrayList<>();
167-
args.add(command);
168-
if (!input.isEmpty())
169-
{
170-
args.add("-i");
171-
args.add(input);
172-
}
173-
if (!output.isEmpty())
174-
{
175-
args.add("-o");
176-
args.add(output);
177-
}
178-
return args.toArray(new String[]{});
179-
}
180-
181-
182-
@TestOnly
183-
public static String[] formatAppArgs(Command command, String input, String output) {
184-
return formatAppArgs(command.getName(), input, output);
185-
}
186185
}

src/test/java/io/yooksi/pz/zdoc/cmd/CommandTest.java

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ void shouldRecognizeAllCommands() {
5151
@Test
5252
void shouldDetectAllCommandLineOptions() throws ParseException {
5353

54-
String[][] argArrays = new String[][] {
55-
new String[] { "-i", "input/path", "-o", "output/path" },
56-
new String[] { "-o", "output/path", "-i", "input/path", }
54+
String[][] argArrays = new String[][]{
55+
new String[]{ "-i", "input/path", "-o", "output/path" },
56+
new String[]{ "-o", "output/path", "-i", "input/path", }
5757
};
5858
for (Command command : Command.WORK_COMMANDS)
5959
{
@@ -72,19 +72,20 @@ void shouldDetectAllCommandLineOptions() throws ParseException {
7272
@Test
7373
void shouldThrowExceptionWhenMissingCommandArguments() {
7474

75-
String[][] missingArgs = new String[][] {
75+
String[][] missingArgs = new String[][]{
7676
// new String[] { "-i", "input/path" }, // missing output path
77-
new String[] { "-o", "output/path" } // missing input path
77+
new String[]{ "-o", "output/path" } // missing input path
7878
};
7979
for (String[] args : missingArgs) {
8080
Arrays.stream(Command.WORK_COMMANDS).forEach(c -> Assertions.assertThrows(ParseException.class,
8181
() -> CommandLine.parse(c.options, ArrayUtils.addFirst(args, c.name))));
8282
}
83-
String[][] correctArgs = new String[][] {
84-
new String[] { "-i", "input/path", "-o", "output/path" },
85-
new String[] { "-o", "output/path", "-i", "input/path", }
83+
String[][] correctArgs = new String[][]{
84+
new String[]{ "-i", "input/path", "-o", "output/path" },
85+
new String[]{ "-o", "output/path", "-i", "input/path", }
8686
};
87-
for (String[] args : correctArgs) {
87+
for (String[] args : correctArgs)
88+
{
8889
Arrays.stream(Command.WORK_COMMANDS).forEach(c -> Assertions.assertDoesNotThrow(() ->
8990
CommandLine.parse(c.options, ArrayUtils.addFirst(args, c.name))));
9091
}

src/test/java/io/yooksi/pz/zdoc/doc/LuaDocTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ void shouldNotThrowExceptionWhenParsingTopLineLuaFile() throws IOException {
5858
}
5959

6060
@Test
61-
void shouldNotWriteToFileIfNoDocElementsFound() throws IOException {
61+
void shouldNotWriteToFileIfNoDocElementsFound() {
6262

6363
String[] expected = new String[]{ "--- No doc elements" };
6464
String actual = writeParseAndReadLua(expected).get(0);
@@ -67,7 +67,7 @@ void shouldNotWriteToFileIfNoDocElementsFound() throws IOException {
6767
}
6868

6969
@Test
70-
void shouldOverwriteExistingLuaAnnotation() throws IOException {
70+
void shouldOverwriteExistingLuaAnnotation() {
7171

7272
List<String> read = writeParseAndReadLua(new String[]{
7373
"--- This is a sample comment",
@@ -78,7 +78,7 @@ void shouldOverwriteExistingLuaAnnotation() throws IOException {
7878
}
7979

8080
@Test
81-
void shouldReadAnnotationsWithWhitespaces() throws IOException {
81+
void shouldReadAnnotationsWithWhitespaces() {
8282

8383
List<String> read = writeParseAndReadLua(new String[]{
8484
"--- @class otherSampleLua",
@@ -88,7 +88,7 @@ void shouldReadAnnotationsWithWhitespaces() throws IOException {
8888
}
8989

9090
@Test
91-
void shouldParseAnnotationIncludeParentType() throws IOException {
91+
void shouldParseAnnotationIncludeParentType() {
9292

9393
String[] write = {
9494
"---@class sampleLua",

0 commit comments

Comments
 (0)