Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

Commit

Permalink
#90: Replaced int with String
Browse files Browse the repository at this point in the history
  • Loading branch information
levBagryansky committed Nov 22, 2023
1 parent 0373986 commit 0d0ab37
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,13 @@ SOFTWARE.
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.9.2</version>
<version>5.10.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>5.9.2</version>
<version>5.10.1</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/EOorg/EOeolang/EOfs/EOfileEOas_inputTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public final class EOfileEOas_inputTest {

@ParameterizedTest
@CsvFileSource(resources = "/EOlang/EOio/test-samples.csv")
public void readsBytes(final String text, final int max) throws IOException {
public void readsBytes(final String text, final String max) throws IOException {
final Path file = this.temp.resolve("test.txt");
Files.write(file, text.getBytes(StandardCharsets.UTF_8));
Phi input = new PhWith(
Expand All @@ -79,7 +79,7 @@ public void readsBytes(final String text, final int max) throws IOException {
new PhMethod(
new PhWith(
input.attr("read").get(),
"max", new Data.ToPhi((long) max)
"max", new Data.ToPhi(Long.parseLong(max))
),
"φ"
)
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/EOorg/EOeolang/EOfs/EOfileEOas_outputTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public final class EOfileEOas_outputTest {

@ParameterizedTest
@CsvFileSource(resources = "/EOlang/EOio/test-samples.csv")
public void writesBytesToFile(final String text, final int max) throws IOException {
public void writesBytesToFile(final String text, final String max) throws IOException {
final Path file = this.temp.resolve("test.txt");
Phi output = new PhWith(
new PhMethod(
Expand All @@ -75,7 +75,7 @@ public void writesBytesToFile(final String text, final int max) throws IOExcepti
int pos = 0;
while (true) {
final byte[] chunk = Arrays.copyOfRange(
bytes, pos, Integer.min(pos + max, bytes.length)
bytes, pos, Integer.min(pos + Integer.parseInt(max), bytes.length)
);
output = new PhConst(
new PhMethod(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public final class EObytes_as_inputEOreadTest {

@ParameterizedTest
@CsvFileSource(resources = "/EOlang/EOio/test-samples.csv")
public void readsBytes(final String text, final int max) throws IOException {
public void readsBytes(final String text, final String max) throws IOException {
final Phi bytes = new Data.ToPhi(text.getBytes(StandardCharsets.UTF_8));
Phi input = new PhWith(
new EObytes_as_input(bytes),
Expand All @@ -60,7 +60,7 @@ public void readsBytes(final String text, final int max) throws IOException {
input = new PhConst(
new PhWith(
input.attr("read").get(),
"max", new Data.ToPhi((long) max)
"max", new Data.ToPhi(Long.parseLong(max))
)
);
final byte[] chunk = new Dataized(input).take(byte[].class);
Expand All @@ -78,7 +78,7 @@ public void readsBytes(final String text, final int max) throws IOException {

@ParameterizedTest
@CsvFileSource(resources = "/EOlang/EOio/test-samples.csv")
public void readsBytesFromString(final String text, final int max) {
public void readsBytesFromString(final String text, final String max) {
final Phi input = new PhWith(
new EObytes_as_input(Phi.Φ),
"b",
Expand All @@ -90,13 +90,13 @@ public void readsBytesFromString(final String text, final int max) {
final Phi first = new PhConst(
new PhWith(
input.attr("read").get(),
"max", new Data.ToPhi((long) max)
"max", new Data.ToPhi(Long.parseLong(max))
)
);
final Phi last = new PhConst(
new PhWith(
first.attr("read").get(),
"max", new Data.ToPhi((long) max)
"max", new Data.ToPhi(Long.parseLong(max))
)
).copy();
Assertions.assertDoesNotThrow(
Expand Down

0 comments on commit 0d0ab37

Please sign in to comment.