Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
shalousun committed Jan 13, 2024
1 parent a01dcb0 commit 5932f09
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
11 changes: 5 additions & 6 deletions src/grammar/lexer.flex
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,6 @@ JavadocEnd = "*"+ "/"
"new" { return Parser.NEW; }
"sealed" { return Parser.SEALED; }
"non-sealed" { return Parser.NON_SEALED; }
"permits" { return Parser.PERMITS; }

"[" { nestingDepth++; return Parser.SQUAREOPEN; }
"]" { nestingDepth--; return Parser.SQUARECLOSE; }
Expand Down Expand Up @@ -317,11 +316,11 @@ JavadocEnd = "*"+ "/"
return Parser.RECORD;
}
"permits" / {WhiteSpace}+ {Id} {
markAnnotatedElementLine();
classDepth++;
braceMode = CODEBLOCK;
pushState(NAME);
return Parser.PERMITS;
markAnnotatedElementLine();
classDepth++;
braceMode = TYPE;
pushState(NAME);
return Parser.PERMITS;
}
"@" {
markAnnotatedElementLine();
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/com/thoughtworks/qdox/PermitsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import java.io.StringReader;

public class PermitsTest {
private JavaProjectBuilder builder = new JavaProjectBuilder();

@Test
public void permitsAsTypeAndIdentifiers() {
Expand All @@ -30,6 +29,7 @@ public void permitsAsTypeAndIdentifiers() {
" this.permits = permits;\n" +
" }\n" +
"}";
builder.addSource( new StringReader(source) );
JavaProjectBuilder javaDocBuilder = new JavaProjectBuilder();
javaDocBuilder.addSource( new StringReader(source) );
}
}
7 changes: 6 additions & 1 deletion src/test/java/com/thoughtworks/qdox/RecordsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ public class RecordsTest

@Test
public void withTwoFields() {
String source = "record Rectangle(double length, double width) { }";
String source = "/**\n" +
" * \n" +
" * @param length length\n" +
" * @param width width\n" +
" */\n" +
"public record Rectangle(double length, double width) { }";
JavaProjectBuilder javaDocBuilder = new JavaProjectBuilder();
javaDocBuilder.addSource( new StringReader(source) );

Expand Down

0 comments on commit 5932f09

Please sign in to comment.