Skip to content

Commit

Permalink
Switch to unittest2
Browse files Browse the repository at this point in the history
  • Loading branch information
zah committed Jul 3, 2022
1 parent 1f67530 commit abd6f38
Show file tree
Hide file tree
Showing 29 changed files with 60 additions and 44 deletions.
3 changes: 2 additions & 1 deletion stew.nimble
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ description = "Backports, standard library candidates and small utilities that
license = "Apache License 2.0"
skipDirs = @["tests"]

requires "nim >= 1.2.0"
requires "nim >= 1.2.0",
"unittest2"

### Helper functions
proc test(args, path: string) =
Expand Down
3 changes: 2 additions & 1 deletion tests/ranges/tbitranges.nim
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import
random, unittest,
random,
unittest2,
../../stew/ranges/bitranges, ../../stew/bitseqs

proc randomBytes(n: int): seq[byte] =
Expand Down
3 changes: 2 additions & 1 deletion tests/ranges/tstackarrays.nim
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import
unittest, math,
math,
unittest2,
../../stew/ptrops,
../../stew/ranges/[stackarrays]

Expand Down
3 changes: 2 additions & 1 deletion tests/ranges/ttypedranges.nim
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import
unittest, sets,
sets,
unittest2,
../../stew/ranges/[typedranges, ptr_arith]

suite "Typed ranges":
Expand Down
2 changes: 1 addition & 1 deletion tests/test_arrayops.nim
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{.used.}

import
std/unittest,
unittest2,
../stew/arrayops

suite "arrayops":
Expand Down
2 changes: 1 addition & 1 deletion tests/test_assign2.nim
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import
std/unittest,
unittest2,
../stew/assign2

suite "assign2":
Expand Down
5 changes: 3 additions & 2 deletions tests/test_base10.nim
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import unittest
import ../stew/base10
import
unittest2,
../stew/base10

when defined(nimHasUsed): {.used.}

Expand Down
5 changes: 3 additions & 2 deletions tests/test_base32.nim
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import unittest
import ../stew/base32
import
unittest2,
../stew/base32

when defined(nimHasUsed): {.used.}

Expand Down
5 changes: 3 additions & 2 deletions tests/test_base58.nim
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import unittest
import ../stew/base58
import
unittest2,
../stew/base58

when defined(nimHasUsed): {.used.}

Expand Down
5 changes: 3 additions & 2 deletions tests/test_base64.nim
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import unittest
import ../stew/[base64, byteutils]
import
unittest2,
../stew/[base64, byteutils]

when defined(nimHasUsed): {.used.}

Expand Down
6 changes: 3 additions & 3 deletions tests/test_bitops2.nim
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import unittest

import ../stew/bitops2
import
unittest2,
../stew/bitops2

template test() =
doAssert bitsof(8'u8) == 8
Expand Down
3 changes: 2 additions & 1 deletion tests/test_bitseqs.nim
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import
unittest, strformat,
strformat,
unittest2,
../stew/[bitseqs]

suite "Bit fields":
Expand Down
2 changes: 1 addition & 1 deletion tests/test_byteutils.nim
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# at your option. This file may not be copied, modified, or distributed except according to those terms.

import
std/unittest,
unittest2,
../stew/byteutils

proc compilationTest {.exportc: "compilationTest".} =
Expand Down
5 changes: 3 additions & 2 deletions tests/test_ctops.nim
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import unittest
import ../stew/ctops
import
unittest2,
../stew/ctops

suite "Constant-time operations test suite":
test "isEqual() test":
Expand Down
6 changes: 3 additions & 3 deletions tests/test_endians2.nim
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import unittest

import ../stew/endians2
import
unittest2,
../stew/endians2

template test() =
doAssert 0x01'u8.toBytesBE == [0x01'u8]
Expand Down
3 changes: 2 additions & 1 deletion tests/test_enums.nim
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import
unittest, typetraits,
typetraits,
unittest2,
../stew/enums

suite "enums":
Expand Down
2 changes: 1 addition & 1 deletion tests/test_interval_set.nim
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# distributed except according to those terms.

import
std/unittest,
unittest2,
../stew/interval_set

const
Expand Down
5 changes: 3 additions & 2 deletions tests/test_io2.nim
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import unittest
import ../stew/io2
import
unittest2,
../stew/io2

suite "OS Input/Output procedures test suite":
test "getCurrentDir() test":
Expand Down
3 changes: 2 additions & 1 deletion tests/test_keyed_queue.nim
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
# according to those terms.

import
std/[algorithm, sequtils, strformat, strutils, tables, unittest],
std/[algorithm, sequtils, strformat, strutils, tables],
unittest2,
../stew/keyed_queue,
../stew/keyed_queue/kq_debug

Expand Down
3 changes: 2 additions & 1 deletion tests/test_leb128.nim
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import
unittest, random,
random,
unittest2,
../stew/[byteutils, leb128, results]

const edgeValues = {
Expand Down
3 changes: 1 addition & 2 deletions tests/test_macros.nim
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import
unittest,
unittest2,
../stew/shims/macros


template unknown() {.pragma.}
template zero() {.pragma.}
template one(one: string) {.pragma.}
Expand Down
3 changes: 2 additions & 1 deletion tests/test_objects.nim
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import
unittest, typetraits,
typetraits,
unittest2,
../stew/objects

when defined(nimHasUsed):
Expand Down
6 changes: 3 additions & 3 deletions tests/test_ptrops.nim
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
#
# at your option. This file may not be copied, modified, or distributed except according to those terms.

import unittest

import ../stew/ptrops
import
unittest2,
../stew/ptrops

var ints = [2, 3, 4]

Expand Down
2 changes: 1 addition & 1 deletion tests/test_sequtils2.nim
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# at your option. This file may not be copied, modified, or distributed except according to those terms.

import
std/unittest,
unittest2,
../stew/sequtils2

suite "sequtils2":
Expand Down
2 changes: 1 addition & 1 deletion tests/test_sets.nim
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import
unittest,
unittest2,
../stew/shims/sets

suite "shims/sets":
Expand Down
4 changes: 2 additions & 2 deletions tests/test_sorted_set.nim
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

import
std/[algorithm, sequtils, strformat, tables],
../stew/sorted_set,
unittest
unittest2,
../stew/sorted_set

const
keyList = [
Expand Down
2 changes: 1 addition & 1 deletion tests/test_templateutils.nim
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import
unittest,
unittest2,
../stew/templateutils

var computations = newSeq[string]()
Expand Down
3 changes: 2 additions & 1 deletion tests/test_varints.nim
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import
unittest, random,
random,
unittest2,
../stew/[varints, byteutils]

const edgeValues = {
Expand Down
5 changes: 3 additions & 2 deletions tests/test_winacl.nim
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import std/unittest
import ../stew/io2
import
unittest2,
../stew/io2

when defined(windows):
import ../stew/windows/acl
Expand Down

0 comments on commit abd6f38

Please sign in to comment.