Skip to content

Commit

Permalink
fix: windows path for the parse APIs
Browse files Browse the repository at this point in the history
Signed-off-by: Peefy <[email protected]>
  • Loading branch information
Peefy committed Oct 22, 2024
1 parent 0317b90 commit 066cc66
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
6 changes: 5 additions & 1 deletion java/src/test/java/com/kcl/ParseFileTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package com.kcl;

import java.nio.file.Path;
import java.nio.file.Paths;

import org.junit.Assert;
import org.junit.Test;

Expand All @@ -10,7 +13,8 @@
public class ParseFileTest {
@Test
public void testParseFile() throws Exception {
ParseFile_Args args = ParseFile_Args.newBuilder().setPath("./src/test_data/parse/main.k").build();
Path path = Paths.get("src", "test_data", "parse", "main.k");
ParseFile_Args args = ParseFile_Args.newBuilder().setPath(path.toString()).build();

API apiInstance = new API();
ParseFile_Result result = apiInstance.parseFile(args);
Expand Down
6 changes: 5 additions & 1 deletion java/src/test/java/com/kcl/ParseProgramTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package com.kcl;

import java.nio.file.Path;
import java.nio.file.Paths;

import org.junit.Assert;
import org.junit.Test;

Expand All @@ -12,7 +15,8 @@
public class ParseProgramTest {
@Test
public void testParseProgram() throws Exception {
ParseProgram_Args args = ParseProgram_Args.newBuilder().addPaths("./src/test_data/parse/main.k").build();
Path path = Paths.get("src", "test_data", "parse", "main.k");
ParseProgram_Args args = ParseProgram_Args.newBuilder().addPaths(path.toString()).build();

API apiInstance = new API();
ParseProgram_Result result = apiInstance.parseProgram(args);
Expand Down
3 changes: 2 additions & 1 deletion kotlin/src/test/kotlin/com/kcl/ParseFileTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ import com.kcl.api.API
import com.kcl.api.parseFileArgs
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.Assertions.assertEquals
import java.nio.file.Paths

class ParseFileTest {
companion object {
private const val TEST_FILE = "./src/test_data/parse/main.k"
private val TEST_FILE = Paths.get("src", "test_data", "parse", "main.k").toString()
}

@Test
Expand Down
3 changes: 2 additions & 1 deletion kotlin/src/test/kotlin/com/kcl/ParseProgramTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ import com.kcl.api.API
import com.kcl.api.parseProgramArgs
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.Assertions.assertEquals
import java.nio.file.Paths

class ParseProgramTest {
companion object {
private const val TEST_FILE = "./src/test_data/parse/main.k"
private val TEST_FILE = Paths.get("src", "test_data", "parse", "main.k").toString()
}

@Test
Expand Down

0 comments on commit 066cc66

Please sign in to comment.