Skip to content

Commit

Permalink
tests: fix import errors
Browse files Browse the repository at this point in the history
From the Nim 2.0 "changes affecting backward compatibility" [1]:

    Relative imports will not resolve to searched paths anymore,
    e.g. `import ./tables` now reports an error properly.

[1] https://github.com/nim-lang/Nim/blob/v2.0.0/changelogs/changelog_2_0_0_details.md#changes-affecting-backward-compatibility
  • Loading branch information
ee7 committed Aug 6, 2023
1 parent 25dcf3b commit a40ee0f
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion tests/all_tests.nim
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import std/[macros, os]
import "."/helpers
import helpers

proc genBracket: NimNode =
const thisDir = currentSourcePath().parentDir().Path()
Expand Down
2 changes: 1 addition & 1 deletion tests/test_binary.nim
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import std/[os, osproc, strformat, strscans, strutils, unittest]
import "."/[exec, helpers, lint/validators, sync/probspecs]
import exec, helpers, lint/validators, sync/probspecs

const
testsDir = currentSourcePath().parentDir()
Expand Down
2 changes: 1 addition & 1 deletion tests/test_fmt.nim
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import std/[importutils, json, os, options, random, strutils, unittest]
import pkg/jsony
import "."/[exec, helpers, sync/sync_common, types_exercise_config]
import exec, helpers, sync/sync_common, types_exercise_config

const
testsDir = currentSourcePath().parentDir()
Expand Down
2 changes: 1 addition & 1 deletion tests/test_generate.nim
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import std/[strutils, unittest]
from "."/generate/generate {.all.} import alterHeadings
from generate/generate {.all.} import alterHeadings

proc testGenerate =
suite "generate":
Expand Down
4 changes: 2 additions & 2 deletions tests/test_lint.nim
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import std/[strutils, unittest]
import "."/lint/validators
import "."/lint/approaches_and_articles {.all.}
import lint/validators
import lint/approaches_and_articles {.all.}

proc testIsKebabCase =
suite "isKebabCase":
Expand Down
2 changes: 1 addition & 1 deletion tests/test_probspecs.nim
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This module contains tests for `src/probspecs.nim`
import std/[json, os, strformat, tables, unittest]
import "."/[cli, exec, sync/probspecs]
import cli, exec, sync/probspecs

proc getProbSpecsExercises(probSpecsDir: ProbSpecsDir): Table[string,
seq[ProbSpecsTestCase]] =
Expand Down
6 changes: 3 additions & 3 deletions tests/test_sync.nim
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import std/[importutils, json, os, options, strutils, unittest]
import "."/[exec, helpers, sync/sync_common, types_exercise_config, types_track_config]
from "."/sync/sync_filepaths {.all.} import update
from "."/sync/sync_metadata {.all.} import UpstreamMetadata, parseMetadataToml,
import exec, helpers, sync/sync_common, types_exercise_config, types_track_config
from sync/sync_filepaths {.all.} import update
from sync/sync_metadata {.all.} import UpstreamMetadata, parseMetadataToml,
metadataAreUpToDate, update

const
Expand Down
2 changes: 1 addition & 1 deletion tests/test_tracks.nim
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file implements tests for `src/tracks.nim`
import std/[os, sequtils, sets, unittest]
import "."/[cli, exec, sync/tracks]
import cli, exec, sync/tracks

const
testsDir = currentSourcePath().parentDir()
Expand Down
2 changes: 1 addition & 1 deletion tests/test_uuid.nim
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import std/unittest
import pkg/uuids
import "."/lint/validators
import lint/validators

proc main =
suite "genUUID: returns a string that isUuidV4 says is valid":
Expand Down

0 comments on commit a40ee0f

Please sign in to comment.