Skip to content

Commit 9f15209

Browse files
committed
Address PR feedback
1 parent 841d6de commit 9f15209

40 files changed

+103
-105
lines changed

pkl-cli/src/test/kotlin/org/pkl/cli/CliTestRunnerTest.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,10 @@ class CliTestRunnerTest {
101101
facts
102102
✘ fail
103103
4 == 9 (/tempDir/test.pkl, line xx)
104-
|
104+
105105
false
106106
1 == 5 (/tempDir/test.pkl, line xx)
107-
|
107+
108108
false
109109
110110
0.0% tests pass [1/1 failed], 0.0% asserts pass [2/2 failed]
@@ -289,7 +289,7 @@ class CliTestRunnerTest {
289289
<testcase classname="test.facts" name="foo"></testcase>
290290
<testcase classname="test.facts" name="bar">
291291
<failure message="Fact Failure">5 == 9 (/tempDir/test.pkl, line xx)
292-
|
292+
293293
false</failure>
294294
</testcase>
295295
<system-err><![CDATA[9 = 9
@@ -494,7 +494,7 @@ class CliTestRunnerTest {
494494
<testcase classname="test1.facts" name="foo"></testcase>
495495
<testcase classname="test1.facts" name="bar">
496496
<failure message="Fact Failure">5 == 9 (/tempDir/test1.pkl, line xx)
497-
|
497+
498498
false</failure>
499499
</testcase>
500500
</testsuite>

pkl-core/src/main/java/org/pkl/core/ast/type/VmTypeMismatchException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
/**
3535
* Indicates that a type check failed. [TypeNode]s use this exception instead of [VmException] to
3636
* make type checking of union types efficient. Note that any [TruffleBoundary] between throw and
37-
* catch location of this exception must a `transferToInterpreterOnException = false`. (Currently
37+
* catch location of this exception must set `transferToInterpreterOnException = false`. (Currently
3838
* there aren't any.)
3939
*/
4040
public abstract class VmTypeMismatchException extends ControlFlowException {

pkl-core/src/main/java/org/pkl/core/runtime/PowerAssertions.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -328,15 +328,13 @@ private static List<SourceSection> lines(SourceSection sourceSection) {
328328
}
329329

330330
public static String trimLeadingWhitespace(String str, int n) {
331-
var start = 0;
332-
var count = 0;
331+
var i = 0;
333332

334-
while (start < str.length() && count < n && Character.isWhitespace(str.charAt(start))) {
335-
start++;
336-
count++;
333+
while (i < str.length() && i < n && Character.isWhitespace(str.charAt(i))) {
334+
i++;
337335
}
338336

339-
return str.substring(start);
337+
return str.substring(i);
340338
}
341339

342340
private static boolean renderLine(
@@ -486,7 +484,7 @@ public int length() {
486484

487485
@Override
488486
public void appendTo(AnsiStringBuilder builder) {
489-
builder.append(AnsiCode.FAINT, "|");
487+
builder.append(AnsiCode.FAINT, "");
490488
}
491489

492490
@Override

pkl-core/src/test/files/LanguageSnippetTests/output/classes/constraints5.err

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ Type constraint `this >= min` violated.
33
Value: 3
44

55
this >= min
6-
| | |
7-
3 | 4
6+
│ │
7+
3 4
88
false
99

1010
x | max: Int(this >= min)

pkl-core/src/test/files/LanguageSnippetTests/output/classes/unionTypesErrorDifferent2.err

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ at unionTypesErrorDifferent2#X.a (file:///$snippetsDir/input/classes/unionTypesE
1111
Value: List(1, 2, 3)
1212

1313
length > 3
14-
| |
14+
1515
3 false
1616

1717
x | a = List(1, 2, 3)

pkl-core/src/test/files/LanguageSnippetTests/output/classes/wrongType6.err

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ Type constraint `!isEmpty` violated.
33
Value: List()
44

55
!isEmpty
6-
||
7-
|true
6+
││
7+
true
88
false
99

1010
x | names: List<String>(!isEmpty)

pkl-core/src/test/files/LanguageSnippetTests/output/errors/constraintDetails1.err

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ Type constraint `firstOneIsSandy` violated.
33
Value: new Listing { new Bird { name = "Bob" }; new Bird { name = ? } }
44

55
(it: Listing<Bird>) -> it[0].name == "Sandy"
6-
| | | |
7-
| | | false
8-
| | "Bob"
9-
| new Bird { name = "Bob" }
6+
│ │
7+
│ │ false
8+
│ │ "Bob"
9+
new Bird { name = "Bob" }
1010
new Listing { new Bird { name = "Bob" }; new Bird { name = ? } }
1111

1212
x | birds: Listing(firstOneIsSandy) = new {

pkl-core/src/test/files/LanguageSnippetTests/output/errors/constraintDetails2.err

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ Type constraint `let (myself: Listing<Bird> = this)
44
Value: new Listing { new Bird { name = "Bob" }; new Bird { name = ? } }
55

66
let (myself: Listing<Bird> = this)
7-
|
7+
88
new Listing { new Bird { name = "Bob" }; new Bird { name = ? } }
99

1010
myself[0].name == "Sandy"
11-
| | | |
12-
| | | false
13-
| | "Bob"
14-
| new Bird { name = "Bob" }
11+
12+
false
13+
"Bob"
14+
new Bird { name = "Bob" }
1515
new Listing { new Bird { name = "Bob" }; new Bird { name = ? } }
1616

1717
x | let (myself: Listing<Bird> = this)

pkl-core/src/test/files/LanguageSnippetTests/output/errors/constraintDetails3.err

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ Type constraint `toList().every((it: Listing<Bird>) -> it[0].name == "Bob")` vio
33
Value: new Listing { new Listing { new Bird { name = "Eagle" }; new Bird { name = ? ...
44

55
toList().every((it: Listing<Bird>) -> it[0].name == "Bob")
6-
| |
7-
| false
6+
7+
false
88
List(new Listing { new Bird { name = "Eagle" }; new Bird { name = ? } })
99

1010
x | foo: Listing(toList().every((it: Listing<Bird>) -> it[0].name == "Bob")) = new {

pkl-core/src/test/files/LanguageSnippetTests/output/errors/intrinsifiedTypeAlias2.err

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Type constraint `isBetween(0, 65535)` violated.
33
Value: -1
44

55
isBetween(0, 65535)
6-
|
6+
77
false
88

99
xxxx | typealias UInt16 = Int(isBetween(0, 65535))

0 commit comments

Comments
 (0)