Skip to content

Commit 18ae192

Browse files
feat: proper unicode characters in error messages (#30)
Co-authored-by: Adolfo Ochagavía <github@adolfo.ochagavia.nl>
1 parent 4c04afc commit 18ae192

16 files changed

+323
-135
lines changed

src/problem.rs

+234-47
Large diffs are not rendered by default.

tests/snapshots/solver__excluded.snap

+7-7
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ source: tests/solver.rs
33
expression: "solve_snapshot(provider, &[\"a\"])"
44
---
55
The following packages are incompatible
6-
|-- a * cannot be installed because there are no viable options:
7-
|-- a 2 would require
8-
|-- b *, which cannot be installed because there are no viable options:
9-
|-- b 1 is excluded because it is externally excluded
10-
|-- a 1 would require
11-
|-- c *, which cannot be installed because there are no viable options:
12-
|-- c 1 is excluded because it is externally excluded
6+
└─ a * cannot be installed because there are no viable options:
7+
├─ a 2 would require
8+
│ └─ b *, which cannot be installed because there are no viable options:
9+
└─ b 1 is excluded because it is externally excluded
10+
└─ a 1 would require
11+
└─ c *, which cannot be installed because there are no viable options:
12+
└─ c 1 is excluded because it is externally excluded
1313

tests/snapshots/solver__merge_excluded.snap

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ source: tests/solver.rs
33
expression: "solve_snapshot(provider, &[\"a\"])"
44
---
55
The following packages are incompatible
6-
|-- a * cannot be installed because there are no viable options:
7-
|-- a 1 | 2 is excluded because it is externally excluded
6+
└─ a * cannot be installed because there are no viable options:
7+
└─ a 1 | 2 is excluded because it is externally excluded
88

tests/snapshots/solver__merge_installable.snap

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ source: tests/solver.rs
33
expression: "solve_snapshot(provider, &[\"a 0..3\", \"a 3..5\"])"
44
---
55
The following packages are incompatible
6-
|-- a >=3, <5 can be installed with any of the following options:
7-
|-- a 3 | 4
8-
|-- a >=0, <3 cannot be installed because there are no viable options:
9-
|-- a 1 | 2, which conflicts with the versions reported above.
6+
├─ a >=3, <5 can be installed with any of the following options:
7+
│ └─ a 3 | 4
8+
└─ a >=0, <3 cannot be installed because there are no viable options:
9+
└─ a 1 | 2, which conflicts with the versions reported above.
1010

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
source: tests/solver.rs
3+
expression: "solve_snapshot(provider, &[\"a 1\", \"a 2..20\"])"
4+
---
5+
The following packages are incompatible
6+
├─ a >=2, <20 can be installed with any of the following options:
7+
│ └─ a 19 | >=16, <=17 | >=9, <=14 | >=2, <=7
8+
└─ a >=1, <2 cannot be installed because there are no viable options:
9+
└─ a 1, which conflicts with the versions reported above.
10+

tests/snapshots/solver__root_excluded.snap

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ source: tests/solver.rs
33
expression: "solve_snapshot(provider, &[\"a\"])"
44
---
55
The following packages are incompatible
6-
|-- a * cannot be installed because there are no viable options:
7-
|-- a 1 is excluded because it is externally excluded
6+
└─ a * cannot be installed because there are no viable options:
7+
└─ a 1 is excluded because it is externally excluded
88

Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
---
22
source: tests/solver.rs
3-
assertion_line: 605
43
expression: error
54
---
65
The following packages are incompatible
7-
|-- b * can be installed with any of the following options:
8-
|-- b 6 | 7 would require
9-
|-- d >=1, <2, which can be installed with any of the following options:
10-
|-- d 1
11-
|-- c * cannot be installed because there are no viable options:
12-
|-- c 1 | 2 would require
13-
|-- d >=2, <3, which cannot be installed because there are no viable options:
14-
|-- d 2, which conflicts with the versions reported above.
6+
├─ b * can be installed with any of the following options:
7+
│ └─ b 6 | 7 would require
8+
└─ d >=1, <2, which can be installed with any of the following options:
9+
└─ d 1
10+
└─ c * cannot be installed because there are no viable options:
11+
└─ c 1 | 2 would require
12+
└─ d >=2, <3, which cannot be installed because there are no viable options:
13+
└─ d 2, which conflicts with the versions reported above.
1514

Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
---
22
source: tests/solver.rs
3-
assertion_line: 671
43
expression: error
54
---
65
The following packages are incompatible
7-
|-- a * can be installed with any of the following options:
8-
|-- a 9 | 10 would require
9-
|-- b *, which can be installed with any of the following options:
10-
|-- b 42 | 100 would require
11-
|-- c >=0, <100, which can be installed with any of the following options:
12-
|-- c 99
13-
|-- c >=101, <104 cannot be installed because there are no viable options:
14-
|-- c 101 | 103, which conflicts with the versions reported above.
6+
├─ a * can be installed with any of the following options:
7+
│ └─ a 9 | 10 would require
8+
└─ b *, which can be installed with any of the following options:
9+
└─ b 42 | 100 would require
10+
└─ c >=0, <100, which can be installed with any of the following options:
11+
└─ c 99
12+
└─ c >=101, <104 cannot be installed because there are no viable options:
13+
└─ c 101 | 103, which conflicts with the versions reported above.
1514

Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
---
22
source: tests/solver.rs
3-
assertion_line: 638
43
expression: error
54
---
65
The following packages are incompatible
7-
|-- bluesky-widgets >=0, <100 can be installed with any of the following options:
8-
|-- bluesky-widgets 42 would require
9-
|-- suitcase-utils >=0, <54, which can be installed with any of the following options:
10-
|-- suitcase-utils 53
11-
|-- suitcase-utils >=54, <100 cannot be installed because there are no viable options:
12-
|-- suitcase-utils 54, which conflicts with the versions reported above.
6+
├─ bluesky-widgets >=0, <100 can be installed with any of the following options:
7+
│ └─ bluesky-widgets 42 would require
8+
└─ suitcase-utils >=0, <54, which can be installed with any of the following options:
9+
└─ suitcase-utils 53
10+
└─ suitcase-utils >=54, <100 cannot be installed because there are no viable options:
11+
└─ suitcase-utils 54, which conflicts with the versions reported above.
1312

Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
---
22
source: tests/solver.rs
3-
assertion_line: 687
43
expression: error
54
---
65
The following packages are incompatible
7-
|-- a * can be installed with any of the following options:
8-
|-- a 9 | 10 would require
9-
|-- b >=50, <100, which can be installed with any of the following options:
10-
|-- b 50
11-
|-- c * cannot be installed because there are no viable options:
12-
|-- c 8 | 10 would constrain
13-
|-- b >=0, <50 , which conflicts with any installable versions previously reported
6+
├─ a * can be installed with any of the following options:
7+
│ └─ a 9 | 10 would require
8+
└─ b >=50, <100, which can be installed with any of the following options:
9+
└─ b 50
10+
└─ c * cannot be installed because there are no viable options:
11+
└─ c 8 | 10 would constrain
12+
└─ b >=0, <50 , which conflicts with any installable versions previously reported
1413

tests/snapshots/solver__unsat_constrains_2.snap

+11-11
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ source: tests/solver.rs
33
expression: error
44
---
55
The following packages are incompatible
6-
|-- a * cannot be installed because there are no viable options:
7-
|-- a 1 | 2 would require
8-
|-- b *, which cannot be installed because there are no viable options:
9-
|-- b 2 would require
10-
|-- c >=2, <3, which cannot be installed because there are no viable options:
11-
|-- c 2 would constrain
12-
|-- a >=3, <4 , which conflicts with any installable versions previously reported
13-
|-- b 1 would require
14-
|-- c >=1, <2, which cannot be installed because there are no viable options:
15-
|-- c 1 would constrain
16-
|-- a >=3, <4 , which conflicts with any installable versions previously reported
6+
└─ a * cannot be installed because there are no viable options:
7+
└─ a 1 | 2 would require
8+
└─ b *, which cannot be installed because there are no viable options:
9+
├─ b 2 would require
10+
│ └─ c >=2, <3, which cannot be installed because there are no viable options:
11+
└─ c 2 would constrain
12+
└─ a >=3, <4 , which conflicts with any installable versions previously reported
13+
└─ b 1 would require
14+
└─ c >=1, <2, which cannot be installed because there are no viable options:
15+
└─ c 1 would constrain
16+
└─ a >=3, <4 , which conflicts with any installable versions previously reported
1717

Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
---
22
source: tests/solver.rs
3-
assertion_line: 612
43
expression: error
54
---
65
The following packages are incompatible
7-
|-- a >=5, <10 can be installed with any of the following options:
8-
|-- a 5
9-
|-- a >=0, <4 cannot be installed because there are no viable options:
10-
|-- a 2, which conflicts with the versions reported above.
6+
├─ a >=5, <10 can be installed with any of the following options:
7+
│ └─ a 5
8+
└─ a >=0, <4 cannot be installed because there are no viable options:
9+
└─ a 2, which conflicts with the versions reported above.
1110

Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
---
22
source: tests/solver.rs
3-
assertion_line: 557
4-
expression: error
3+
expression: "solve_snapshot(provider, &[\"asdf\"])"
54
---
65
The following packages are incompatible
7-
|-- asdf * can be installed with any of the following options:
8-
|-- asdf 1 would require
9-
|-- c >=2, <3, which can be installed with any of the following options:
10-
|-- c 2
11-
|-- c 1 is locked, but another version is required as reported above
6+
└─ asdf * can be installed with any of the following options:
7+
└─ asdf 1 would require
8+
└─ c >=2, <3, which can be installed with any of the following options:
9+
└─ c 2
10+
└─ c 1 is locked, but another version is required as reported above
1211

Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
---
22
source: tests/solver.rs
3-
assertion_line: 565
43
expression: error
54
---
65
asdf * cannot be installed because there are no viable options:
7-
|-- asdf 1 would require
8-
|-- c >=2, <3, for which no candidates were found.
6+
└─ asdf 1 would require
7+
└─ c >=2, <3, for which no candidates were found.
98

Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
---
22
source: tests/solver.rs
3-
assertion_line: 573
43
expression: error
54
---
65
a >=0, <1000 cannot be installed because there are no viable options:
7-
|-- a 41 would require
8-
|-- B >=0, <20, for which no candidates were found.
6+
└─ a 41 would require
7+
└─ B >=0, <20, for which no candidates were found.
98

Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
---
22
source: tests/solver.rs
3-
assertion_line: 655
43
expression: error
54
---
65
The following packages are incompatible
7-
|-- menu * can be installed with any of the following options:
8-
|-- menu 10 would require
9-
|-- dropdown >=1, <2, which can be installed with any of the following options:
10-
|-- dropdown 1 would require
11-
|-- intl >=3, <4, which can be installed with any of the following options:
12-
|-- intl 3
13-
|-- icons >=1, <2 can be installed with any of the following options:
14-
|-- icons 1
15-
|-- intl >=5, <6 cannot be installed because there are no viable options:
16-
|-- intl 5, which conflicts with the versions reported above.
6+
├─ menu * can be installed with any of the following options:
7+
│ └─ menu 10 would require
8+
└─ dropdown >=1, <2, which can be installed with any of the following options:
9+
└─ dropdown 1 would require
10+
└─ intl >=3, <4, which can be installed with any of the following options:
11+
└─ intl 3
12+
├─ icons >=1, <2 can be installed with any of the following options:
13+
│ └─ icons 1
14+
└─ intl >=5, <6 cannot be installed because there are no viable options:
15+
└─ intl 5, which conflicts with the versions reported above.
1716

0 commit comments

Comments
 (0)