Skip to content

Commit

Permalink
Add munit.internal.junitinterface.{PendingCommentTag, PendingTag}
Browse files Browse the repository at this point in the history
  • Loading branch information
jnd-au committed Oct 10, 2024
1 parent dfeaf77 commit c5a7b21
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,10 @@ void logTo(RichLogger logger) {
for (Annotation annotation : desc.getAnnotations()) {
if (annotation instanceof Tag) {
Tag tag = (Tag) annotation;
String kind = tag.getClass().getName();
if (kind.equals("munit.Tag") && tag.value().equals("Pending")) {
if (tag instanceof PendingTag) {
isPending = true;
}
else if (kind.equals("munit.package$PendingComment")) {
else if (tag instanceof PendingCommentTag) {
builder.append(" ");
builder.append(tag.value());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package munit.internal.junitinterface;

public interface PendingCommentTag extends Tag {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package munit.internal.junitinterface;

public interface PendingTag extends Tag {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package munit.internal.junitinterface

trait PendingCommentTag extends Tag
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package munit.internal.junitinterface

trait PendingTag extends Tag
6 changes: 4 additions & 2 deletions munit/shared/src/main/scala/munit/package.scala
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import munit.internal.junitinterface.{PendingCommentTag, PendingTag}

package object munit {
case class PendingComment(override val value: String) extends Tag(value)
case class PendingComment(override val value: String) extends Tag(value) with PendingCommentTag

val Ignore = new Tag("Ignore")
val Only = new Tag("Only")
val Flaky = new Tag("Flaky")
val Fail = new Tag("Fail")
val Pending = new Tag("Pending")
val Pending = new Tag("Pending") with PendingTag
val Slow = new Tag("Slow")
}

0 comments on commit c5a7b21

Please sign in to comment.