diff --git a/tests/extensions/testcompression.nim b/tests/extensions/testcompression.nim index 3efcc64..e6b2208 100644 --- a/tests/extensions/testcompression.nim +++ b/tests/extensions/testcompression.nim @@ -1,5 +1,5 @@ ## nim-websock -## Copyright (c) 2021 Status Research & Development GmbH +## Copyright (c) 2021-2022 Status Research & Development GmbH ## Licensed under either of ## * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE)) ## * MIT license ([LICENSE-MIT](LICENSE-MIT)) @@ -8,7 +8,7 @@ ## those terms. import std/os -import pkg/[chronicles, chronos/unittest2/asynctests, stew/io2] +import pkg/[chronos/unittest2/asynctests, stew/io2] import ../../websock/websock import ../../websock/extensions/compression/deflate diff --git a/tests/extensions/testexts.nim b/tests/extensions/testexts.nim index 391fb95..6fd9661 100644 --- a/tests/extensions/testexts.nim +++ b/tests/extensions/testexts.nim @@ -1,5 +1,5 @@ ## nim-websock -## Copyright (c) 2021 Status Research & Development GmbH +## Copyright (c) 2021-2022 Status Research & Development GmbH ## Licensed under either of ## * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE)) ## * MIT license ([LICENSE-MIT](LICENSE-MIT)) @@ -7,7 +7,7 @@ ## This file may not be copied, modified, or distributed except according to ## those terms. -import pkg/[chronicles, chronos/unittest2/asynctests, stew/byteutils] +import pkg/[chronos/unittest2/asynctests, stew/byteutils] import ./base64ext, ./hexext import ../../websock/websock, ../helpers diff --git a/tests/testhooks.nim b/tests/testhooks.nim index 3a2d1e8..a8a8ce4 100644 --- a/tests/testhooks.nim +++ b/tests/testhooks.nim @@ -1,5 +1,5 @@ ## nim-websock -## Copyright (c) 2021 Status Research & Development GmbH +## Copyright (c) 2021-2022 Status Research & Development GmbH ## Licensed under either of ## * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE)) ## * MIT license ([LICENSE-MIT](LICENSE-MIT)) @@ -10,7 +10,6 @@ import pkg/[ httputils, chronos/unittest2/asynctests, - chronicles, ] import ../websock/websock diff --git a/tests/testwebsockets.nim b/tests/testwebsockets.nim index 0a15d5a..db10082 100644 --- a/tests/testwebsockets.nim +++ b/tests/testwebsockets.nim @@ -1,5 +1,5 @@ ## nim-websock -## Copyright (c) 2021 Status Research & Development GmbH +## Copyright (c) 2021-2022 Status Research & Development GmbH ## Licensed under either of ## * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE)) ## * MIT license ([LICENSE-MIT](LICENSE-MIT)) @@ -1011,7 +1011,7 @@ suite "Partial frames": if pos >= res.len: break - res.setlen(pos) + res.setLen(pos) check res.len == howMuchWood.toBytes().len check res == howMuchWood.toBytes() await ws.waitForClose() diff --git a/websock.nimble b/websock.nimble index 4644a83..6fdff83 100644 --- a/websock.nimble +++ b/websock.nimble @@ -26,9 +26,15 @@ requires "zlib" task test, "run tests": let envNimflags = getEnv("NIMFLAGS") + styleCheckStyle = + if (NimMajor, NimMinor) < (1, 6): + "hint" + else: + "error" nimFlags = envNimFlags & " --verbosity:0 --hints:off --hint:Name:on " & - "--styleCheck:usages --styleCheck:hint -d:chronosStrictException" + "--styleCheck:usages --styleCheck:" & styleCheckStyle & + " -d:chronosStrictException" # dont't need to run it, only want to test if it is compileable exec "nim c -c " & nimFlags & " -d:chronicles_log_level=TRACE -d:chronicles_sinks:json --styleCheck:usages --styleCheck:hint ./tests/all_tests" diff --git a/websock/session.nim b/websock/session.nim index c6da237..f243318 100644 --- a/websock/session.nim +++ b/websock/session.nim @@ -1,5 +1,5 @@ ## nim-websock -## Copyright (c) 2021 Status Research & Development GmbH +## Copyright (c) 2021-2022 Status Research & Development GmbH ## Licensed under either of ## * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE)) ## * MIT license ([LICENSE-MIT](LICENSE-MIT))