Skip to content

Commit

Permalink
[ fix ] Tweak the source location before Agda-2.6.4
Browse files Browse the repository at this point in the history
  • Loading branch information
banacorn committed Nov 23, 2024
1 parent b1de37c commit 173e4f8
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
14 changes: 13 additions & 1 deletion lib/js/test/tests/Test__Tokens.bs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 12 additions & 1 deletion test/tests/Test__Tokens.res
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,17 @@ describe("Tokens", () => {
->Array.map(
((token, range)) => Editor.Range.toString(range) ++ " " ++ Tokens.Token.toString(token),
)

let srcOfPrimitive = switch ctx.state.agdaVersion {
| Some(version) =>
if Util.Version.gte(version, "2.6.4") {
"[src: 388]"
} else {
"[src: 320]"
}
| None => raise(Failure("No Agda version found"))
}

Assert.deepEqual(
[
"0:0-6 Token (0, 6) [Keyword]",
Expand All @@ -36,7 +47,7 @@ describe("Tokens", () => {
"1:0-4 Token (28, 32) [Keyword]",
"1:5-6 Token (33, 34) [Datatype] [src: 34]",
"1:7-8 Token (35, 36) [Symbol]",
"1:9-12 Token (37, 40) [Primitive] [src: 388]",
"1:9-12 Token (37, 40) [Primitive] " ++ srcOfPrimitive,
"1:13-18 Token (41, 46) [Keyword]",
"2:2-3 Token (49, 50) [ConstructorInductive] [src: 50]",
"2:4-5 Token (51, 52) [Symbol]",
Expand Down

0 comments on commit 173e4f8

Please sign in to comment.