Skip to content

Commit

Permalink
fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
metagn committed Oct 3, 2024
1 parent bd53e77 commit 822835c
Show file tree
Hide file tree
Showing 21 changed files with 32 additions and 17 deletions.
5 changes: 5 additions & 0 deletions lib/packages/docutils/dochelpers.nim
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import std/strutils

when defined(nimPreviewSlimSystem):
import std/[assertions, syncio]
from std/objectequals import nil


type
Expand All @@ -42,6 +43,10 @@ proc `$`*(s: LangSymbol): string = # for debug
s.symKind, s.symTypeKind , s.name, s.generics, $s.isGroup,
$s.parametersProvided, $s.parameters, s.outType]

when defined(nimPreviewSlimSystem):
proc `==`*(a, b: LangSymbol): bool {.inline.} =
result = objectequals.`==`(a, b)

func nimIdentBackticksNormalize*(s: string): string =
## Normalizes the string `s` as a Nim identifier.
##
Expand Down
4 changes: 4 additions & 0 deletions lib/pure/collections/heapqueue.nim
Original file line number Diff line number Diff line change
Expand Up @@ -264,3 +264,7 @@ proc `$`*[T](heap: HeapQueue[T]): string =
if result.len > 1: result.add(", ")
result.addQuoted(x)
result.add("]")

proc `==`*[T](a, b: HeapQueue[T]): bool {.inline.} =
## Equality operator for heaps.
result = a.data == b.data
5 changes: 5 additions & 0 deletions lib/system.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1778,6 +1778,11 @@ proc pop*[T](s: var seq[T]): T {.inline, noSideEffect.} =
result = s[L]
setLen(s, L)

proc `==`*[T, U](x, y: HSlice[T, U]): bool {.inline.} =
## Equality operator for slices.
mixin `==`
result = x.a == y.a and x.b == y.b

when defined(nimPreviewSlimSystem):
# no `object`, moved to std/objectequals
proc `==`*[T: tuple](x, y: T): bool =
Expand Down
2 changes: 1 addition & 1 deletion tests/stdlib/concurrency/tatomics.nim
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ discard """
# test atomic operations

import std/[atomics, bitops]
import std/assertions
import std/[assertions, objectequals]


type
Expand Down
2 changes: 1 addition & 1 deletion tests/stdlib/talgorithm.nim
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ discard """
#12928,10456

import std/[sequtils, algorithm, json, sugar]
import std/assertions
import std/[assertions, objectequals]

proc test() =
try:
Expand Down
2 changes: 1 addition & 1 deletion tests/stdlib/tgenast.nim
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ discard """
import std/genasts
import std/macros
from std/strformat import `&`
import std/assertions
import std/[assertions, objectequals]
import ./mgenast

proc main =
Expand Down
2 changes: 1 addition & 1 deletion tests/stdlib/timportutils.nim
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ discard """
matrix: "--mm:refc; --mm:orc"
"""

import std/[importutils, assertions]
import std/[importutils, assertions, objectequals]
import stdtest/testutils
import mimportutils

Expand Down
2 changes: 1 addition & 1 deletion tests/stdlib/tjson.nim
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ when not defined(js):
import std/streams
import stdtest/testutils
from std/fenv import epsilon
import std/[assertions, objectdollar]
import std/[assertions, objectdollar, objectequals]

proc testRoundtrip[T](t: T, expected: string) =
# checks that `T => json => T2 => json2` is such that json2 = json
Expand Down
2 changes: 1 addition & 1 deletion tests/stdlib/tjsonmacro.nim
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ discard """
"""

import json, strutils, options, tables
import std/assertions
import std/[assertions, objectequals]

# The definition of the `%` proc needs to be here, since the `% c` calls below
# can only find our custom `%` proc for `Pix` if defined in global scope.
Expand Down
2 changes: 1 addition & 1 deletion tests/stdlib/tjsonutils.nim
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import std/json
from std/math import isNaN, signbit
from std/fenv import epsilon
from stdtest/testutils import whenRuntimeJs
import std/[assertions, objectdollar]
import std/[assertions, objectdollar, objectequals]

proc testRoundtrip[T](t: T, expected: string) =
# checks that `T => json => T2 => json2` is such that json2 = json
Expand Down
2 changes: 1 addition & 1 deletion tests/stdlib/tmarshal.nim
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ discard """
"""

import std/marshal
import std/[assertions, objectdollar, streams]
import std/[assertions, objectdollar, objectequals, streams]

# TODO: add static tests

Expand Down
2 changes: 1 addition & 1 deletion tests/stdlib/tposix.nim
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ discard """
when not defined(windows):

import posix
import std/[assertions, syncio]
import std/[assertions, syncio, objectequals]

var
u: Utsname
Expand Down
2 changes: 1 addition & 1 deletion tests/stdlib/trandom.nim
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ discard """
joinable: false # to avoid messing with global rand state
matrix: "--mm:refc; --mm:orc; --backend:js --jsbigint64:off -d:nimStringHash2; --backend:js --jsbigint64:on"
"""
import std/[assertions, formatfloat]
import std/[assertions, formatfloat, objectequals]
import std/[random, math, stats, sets, tables]
import std/private/jsutils
when not defined(js):
Expand Down
2 changes: 1 addition & 1 deletion tests/stdlib/tsequtils.nim
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ discard """
import std/sequtils
import strutils
from algorithm import sorted
import std/assertions
import std/[assertions, objectequals]

{.experimental: "strictEffects".}
{.push warningAsError[Effect]: on.}
Expand Down
1 change: 1 addition & 0 deletions tests/stdlib/tsortcall.nim
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ discard """

import algorithm
import unittest
import std/objectequals


suite "test sort, sorted, and isSorted procs":
Expand Down
2 changes: 1 addition & 1 deletion tests/stdlib/tsugar.nim
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ x + y = 30
'''
"""
import std/[sugar, algorithm, random, sets, tables, strutils, sequtils]
import std/[syncio, assertions]
import std/[syncio, assertions, objectequals]

type # for capture test, ref #20679
FooCapture = ref object
Expand Down
2 changes: 1 addition & 1 deletion tests/stdlib/ttables.nim
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ discard """
"""

import tables, hashes
import std/assertions
import std/[assertions, objectequals]

type
Person = object
Expand Down
2 changes: 1 addition & 1 deletion tests/stdlib/ttimes.nim
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ discard """
"""

import times, strutils, unittest
import std/assertions
import std/[assertions, objectequals]

when not defined(js):
import os
Expand Down
2 changes: 1 addition & 1 deletion tests/stdlib/tunittest.nim
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ matrix: "--mm:refc; --mm:orc"
targets: "c js"
"""

import std/[unittest, sequtils, assertions]
import std/[unittest, sequtils, assertions, objectequals]
from std/unittest {.all.} import matchFilter

proc doThings(spuds: var int): int =
Expand Down
2 changes: 1 addition & 1 deletion tests/stdlib/turi.nim
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ discard """
import std/uri
from std/uri {.all.} as uri2 import removeDotSegments
from std/sequtils import toSeq
import std/assertions
import std/[assertions, objectequals]

template main() =
block: # encodeUrl, decodeUrl
Expand Down
2 changes: 1 addition & 1 deletion tests/stdlib/twrapnils.nim
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ discard """

import std/wrapnils
from std/options import get, isSome
import std/assertions
import std/[assertions, objectequals]

proc checkNotZero(x: float): float =
doAssert x != 0
Expand Down

0 comments on commit 822835c

Please sign in to comment.