Skip to content

Commit

Permalink
test: Fix tests in Nim 2.2 (#2199)
Browse files Browse the repository at this point in the history
  • Loading branch information
fox0430 authored Oct 28, 2024
1 parent 55c896d commit 44af01f
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.. _#2199: https://github.com/fox0430/moe/pull/2199

Fixed
.....

- `#2199`_ test: Fix tests in Nim 2.2

27 changes: 22 additions & 5 deletions tests/tsyntaxcheck.nim
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#[###################### GNU General Public License 3.0 ######################]#
# #
# Copyright (C) 2017─2023 Shuhei Nogawa #
# Copyright (C) 2017─2024 Shuhei Nogawa #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
Expand Down Expand Up @@ -338,7 +338,12 @@ echo "Hello world"
let r = testFilePath.parseNimCheckResult(output).get

check r.len == 1
check r[0].position == BufferPosition(line: 0, column: 10)

when (NimMajor, NimMinor) >= (2, 2):
check r[0].position == BufferPosition(line: 0, column: 11)
else:
check r[0].position == BufferPosition(line: 0, column: 10)

check r[0].messageType == SyntaxCheckMessageType.warning
check r[0].message.len > 0

Expand Down Expand Up @@ -378,11 +383,19 @@ echo "Hello world"

check r.len == 2

check r[0].position == BufferPosition(line: 0, column: 10)
when (NimMajor, NimMinor) >= (2, 2):
check r[0].position == BufferPosition(line: 0, column: 11)
else:
check r[0].position == BufferPosition(line: 0, column: 10)

check r[0].messageType == SyntaxCheckMessageType.warning
check r[0].message.len > 0

check r[1].position == BufferPosition(line: 1, column: 10)
when (NimMajor, NimMinor) >= (2, 2):
check r[1].position == BufferPosition(line: 1, column: 11)
else:
check r[1].position == BufferPosition(line: 1, column: 10)

check r[1].messageType == SyntaxCheckMessageType.warning
check r[1].message.len > 0

Expand Down Expand Up @@ -431,7 +444,11 @@ echo "Hello world"
check r[0].messageType == SyntaxCheckMessageType.hint
check r[0].message.len > 0

check r[1].position == BufferPosition(line: 0, column: 10)
when (NimMajor, NimMinor) >= (2, 2):
check r[1].position == BufferPosition(line: 0, column: 11)
else:
check r[1].position == BufferPosition(line: 0, column: 10)

check r[1].messageType == SyntaxCheckMessageType.warning
check r[1].message.len > 0

Expand Down

0 comments on commit 44af01f

Please sign in to comment.