Skip to content

Commit

Permalink
feat(objectionary#2146): fix half of the problems with jtcop
Browse files Browse the repository at this point in the history
  • Loading branch information
volodya-lombrozo committed Jun 16, 2023
1 parent bce5fae commit 48bb719
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 20 deletions.
3 changes: 3 additions & 0 deletions eo-runtime/src/test/java/EOorg/EOeolang/EObool$EOnotTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@
* Test case for {@link EObool$EOnot}.
* {@link EOorg.EOeolang.EObool$EOnot} is the generated class. This is the reason
* why we disable jtcop check.
*
* @since 0.1
* @checkstyle TypeNameCheck (2 lines)
*/
@SuppressWarnings("JTCOP.RuleAllTestsHaveProductionClass")
final class EObool$EOnotTest {

@Test
Expand Down
1 change: 1 addition & 0 deletions eo-runtime/src/test/java/EOorg/EOeolang/EOfailed.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@
*
* @since 0.29
*/
@SuppressWarnings("JTCOP.RuleAllTestsHaveProductionClass")
final class EOfailed extends PhDefault {
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@
* Test case for {@link EOheap$EOpointer$EOblock}.
*
* @since 0.19
* @checkstyle TypeNameCheck (4 lines)
*/
final class EOheapEOpointerEOblockTest {
final class EOheap$EOpointer$EOblockTest {

@Test
void writesBytesIntoHeap() {
Expand All @@ -61,7 +62,7 @@ void writesBytesIntoHeap() {
new PhMethod(pointer, "block"),
0, new Data.ToPhi((long) bytes.length)
),
1, new EOheapEOpointerEOblockTest.Inverse(Phi.Φ)
1, new EOheap$EOpointer$EOblockTest.Inverse(Phi.Φ)
);
new Dataized(
new PhWith(
Expand Down
5 changes: 4 additions & 1 deletion eo-runtime/src/test/java/EOorg/EOeolang/EOint$EOeqTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,14 @@
import org.junit.jupiter.api.Test;

/**
* Test case for {@link EOint}.
* Test case for {@link EOint$EOeq}.
* {@link EOint$EOlt} is the generated class. This is the reason
* why we disable jtcop check.
*
* @since 0.1
* @checkstyle TypeNameCheck (2 lines)
*/
@SuppressWarnings("JTCOP.RuleAllTestsHaveProductionClass")
final class EOint$EOeqTest {

@Test
Expand Down
5 changes: 4 additions & 1 deletion eo-runtime/src/test/java/EOorg/EOeolang/EOint$EOltTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,14 @@
import org.junit.jupiter.api.Test;

/**
* Test case for {@link EOint}.
* Test case for {@link EOint$EOlt}.
* {@link EOint$EOlt} is the generated class. This is the reason
* why we disable jtcop check.
*
* @since 0.1
* @checkstyle TypeNameCheck (2 lines)
*/
@SuppressWarnings("JTCOP.RuleAllTestsHaveProductionClass")
final class EOint$EOltTest {

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,14 @@
import org.junit.jupiter.api.Test;

/**
* Test case for {@link EOint}.
* Test case for {@link EOint$EOminus}.
* {@link EOint$EOminus} is the generated class. This is the reason
* why we disable jtcop check.
*
* @since 0.1
* @checkstyle TypeNameCheck (2 lines)
*/
@SuppressWarnings("JTCOP.RuleAllTestsHaveProductionClass")
final class EOint$EOminusTest {

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,15 @@
import org.junit.jupiter.api.Test;

/**
* Test case for {@link EOint}.
* Test case for {@link EOint$EOneg}.
* {@link EOint$EOneg} is the generated class. This is the reason
* why we disable jtcop check.
*
* @since 0.1
* @checkstyle TypeNameCheck (4 lines)
*/
final class EOintTest {
@SuppressWarnings("JTCOP.RuleAllTestsHaveProductionClass")
final class EOint$EOnegTest {

@Test
void negatesNumber() {
Expand Down
27 changes: 15 additions & 12 deletions eo-runtime/src/test/java/EOorg/EOeolang/EOio/EOstdinTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,27 +46,30 @@

/**
* Test case for {@link EOstdin}.
* {@link EOstdin} is the generated class. This is the reason
* why we disable jtcop check.
*
* @since 0.23
*/
public final class EOstdinTest {
@SuppressWarnings("JTCOP.RuleAllTestsHaveProductionClass")
final class EOstdinTest {

/**
* DEFAULT_STDIN.
*/
private static final InputStream DEFAULT_STDIN = System.in;

@AfterAll
public static void restoreSystemInput() {
static void restoreSystemInput() {
MatcherAssert.assertThat(
System.in,
Matchers.equalTo(DEFAULT_STDIN)
Matchers.equalTo(EOstdinTest.DEFAULT_STDIN)
);
}

@AfterEach
@ReadsStdIo
public void clearInput() {
void clearInput() {
final Input input = Input.getInstance();
try {
final Field prop = input.getClass().getDeclaredField("instance");
Expand All @@ -81,7 +84,7 @@ public void clearInput() {

@StdIo("this is a test input!")
@Test
public void dataizesNextLineOneLine(final StdIn stdin) {
void dataizesNextLineOneLine(final StdIn stdin) {
final String expected = "this is a test input!";
final Phi phi = new PhMethod(new PhCopy(new EOstdin(Phi.Φ)), "next-line");
final String actual = new Dataized(phi).take(String.class);
Expand All @@ -93,7 +96,7 @@ public void dataizesNextLineOneLine(final StdIn stdin) {

@StdIo("this is a testing input!")
@Test
public void dataizesStdinOneLine(final StdIn stdin) {
void dataizesStdinOneLine(final StdIn stdin) {
final String expected = "this is a testing input!".concat(System.lineSeparator());
final Phi phi = new PhCopy(new EOstdin(Phi.Φ));
final String actual = new Dataized(phi).take(String.class);
Expand All @@ -105,7 +108,7 @@ public void dataizesStdinOneLine(final StdIn stdin) {

@StdIo({"this is a test input!", "another line", "yet another line"})
@Test
public void dataizesNextLineMultiLine(final StdIn stdin) {
void dataizesNextLineMultiLine(final StdIn stdin) {
final String expected = "this is a test input!";
final Phi phi = new PhMethod(new PhCopy(new EOstdin(Phi.Φ)), "next-line");
final String actual = new Dataized(phi).take(String.class);
Expand All @@ -117,7 +120,7 @@ public void dataizesNextLineMultiLine(final StdIn stdin) {

@StdIo("")
@Test
public void dataizesNextLineEmpty(final StdIn stdin) {
void dataizesNextLineEmpty(final StdIn stdin) {
final Phi phi = new PhMethod(new PhCopy(new EOstdin(Phi.Φ)), "next-line");
final EOerror.ExError error = Assertions.assertThrows(
EOerror.ExError.class,
Expand All @@ -133,7 +136,7 @@ public void dataizesNextLineEmpty(final StdIn stdin) {

@StdIo("")
@Test
public void dataizesEmptyStdin(final StdIn stdin) {
void dataizesEmptyStdin(final StdIn stdin) {
final String expected = "";
final Phi phi = new PhCopy(new EOstdin(Phi.Φ));
final String actual = new Dataized(phi).take(String.class);
Expand All @@ -145,7 +148,7 @@ public void dataizesEmptyStdin(final StdIn stdin) {

@StdIo({"this is a test input!", "another line", "yet another line"})
@Test
public void dataizesStdinMultiLine(final StdIn stdin) {
void dataizesStdinMultiLine(final StdIn stdin) {
final String first = "this is a test input!".concat(System.lineSeparator());
final String second = "another line".concat(System.lineSeparator());
final String third = "yet another line".concat(System.lineSeparator());
Expand All @@ -159,7 +162,7 @@ public void dataizesStdinMultiLine(final StdIn stdin) {

@StdIo({"first", "second", "third"})
@Test
public void dataizesStdinFewOneLine(final StdIn stdin) {
void dataizesStdinFewOneLine(final StdIn stdin) {
final String first = "\u0066\u0069\u0072\u0073\u0074";
final String second = "\u0073\u0065\u0063\u006F\u006E\u0064";
final String third = "\u0074\u0068\u0069\u0072\u0064";
Expand All @@ -185,7 +188,7 @@ public void dataizesStdinFewOneLine(final StdIn stdin) {

@StdIo({"first", "", "third"})
@Test
public void dataizesStdinEmptyLineBetweenNonEmpty(final StdIn stdin) {
void dataizesStdinEmptyLineBetweenNonEmpty(final StdIn stdin) {
final String first = "\u0066\u0069\u0072\u0073\u0074";
final String third = "\u0074\u0068\u0069\u0072\u0064";
Phi phi = new PhMethod(new PhCopy(new EOstdin(Phi.Φ)), "next-line");
Expand Down
5 changes: 4 additions & 1 deletion eo-runtime/src/test/java/EOorg/EOeolang/EOstringTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,14 @@
import org.junit.jupiter.api.Test;

/**
* Test case for {@link EOstring}.
* Test case for {@link EOstring$EOeq}.
* {@link EOorg.EOeolang.EOio.EOstdin} is the generated class. This is the reason
* why we disable jtcop check.
*
* @since 0.17
* @checkstyle TypeNameCheck (4 lines)
*/
@SuppressWarnings("JTCOP.RuleAllTestsHaveProductionClass")
final class EOstringTest {

@Test
Expand Down

0 comments on commit 48bb719

Please sign in to comment.