test removing dollar for objects out of system (#20242)
* test removing dollar for objects out of system * test & fixes * fix bootstrap * use nimPreviewSlimSystem, test stdlib category * fix test
This commit is contained in:
parent
9d9ecc3c1d
commit
b8dc58d884
9 changed files with 84 additions and 40 deletions
14
tests/stdlib/tobjectdollar.nim
Normal file
14
tests/stdlib/tobjectdollar.nim
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
discard """
|
||||
matrix: "-d:nimPreviewSlimSystem"
|
||||
"""
|
||||
|
||||
import std/assertions
|
||||
|
||||
type Foo = object
|
||||
a, b: int
|
||||
|
||||
let x = Foo(a: 23, b: 45)
|
||||
doAssert not compiles($x)
|
||||
import std/objectdollar
|
||||
doAssert compiles($x)
|
||||
doAssert $x == "(a: 23, b: 45)"
|
||||
|
|
@ -4,6 +4,9 @@ discard """
|
|||
|
||||
import std/[json, options]
|
||||
|
||||
when defined(nimPreviewSlimSystem):
|
||||
import std/objectdollar
|
||||
|
||||
|
||||
# RefPerson is used to test that overloaded `==` operator is not called by
|
||||
# options. It is defined here in the global scope, because otherwise the test
|
||||
|
|
|
|||
|
|
@ -3,6 +3,9 @@
|
|||
import genericstrformat
|
||||
import std/[strformat, strutils, times, tables, json]
|
||||
|
||||
when defined(nimPreviewSlimSystem):
|
||||
import std/objectdollar
|
||||
|
||||
proc main() =
|
||||
block: # issue #7632
|
||||
doAssert works(5) == "formatted 5"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue