Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unittest fails to match 5 against "5"?!? #1

Open
smoe opened this issue Nov 11, 2020 · 0 comments · May be fixed by #2
Open

unittest fails to match 5 against "5"?!? #1

smoe opened this issue Nov 11, 2020 · 0 comments · May be fixed by #2

Comments

@smoe
Copy link

smoe commented Nov 11, 2020

$ nimble --verbose test
  Verifying dependencies for [email protected]
  Compiling /home/moeller/git/nim-team/nim-d3/nim-d3-0.1.3/tests/test1 (from package d3) using js backend
  Executing /usr/bin/nim js --noNimblePath -d:NimblePkgVersion=0.1.3 -r --path:. /home/moeller/git/nim-team/nim-d3/nim-d3-0.1.3/tests/test1
Hint: used config file '/etc/nim/nim.cfg' [Conf]
Hint: used config file '/etc/nim/config.nims' [Conf]
Hint: used config file '/home/moeller/git/nim-team/nim-d3/nim-d3-0.1.3/tests/config.nims' [Conf]
............................
/home/moeller/git/nim-team/nim-d3/nim-d3-0.1.3/src/d3/d3_axis.nim(6, 8) Warning: imported and not used: 'sequtils' [UnusedImport]
.
/home/moeller/git/nim-team/nim-d3/nim-d3-0.1.3/src/d3/d3_format.nim(6, 8) Warning: imported and not used: 'sequtils' [UnusedImport]
....
/home/moeller/git/nim-team/nim-d3/nim-d3-0.1.3/src/d3/d3_time_format.nim(6, 8) Warning: imported and not used: 'sequtils' [UnusedImport]
/home/moeller/git/nim-team/nim-d3/nim-d3-0.1.3/tests/test1.nim(11, 6) template/generic instantiation of `test` from here
/home/moeller/git/nim-team/nim-d3/nim-d3-0.1.3/tests/test1.nim(12, 9) template/generic instantiation of `check` from here
/usr/lib/nim/pure/unittest.nim(646, 43) Error: type mismatch: got <int literal(5), int literal(5)>
but expected one of: 
proc add(x: var cstring; y: cstring)
  first type mismatch at position: 1
  required type for x: var cstring
  but expression '5' is of type: int literal(5)
proc add(x: var string; y: char)
  first type mismatch at position: 1
  required type for x: var string
  but expression '5' is of type: int literal(5)
proc add(x: var string; y: cstring)
  first type mismatch at position: 1
  required type for x: var string
  but expression '5' is of type: int literal(5)
proc add(x: var string; y: string)
  first type mismatch at position: 1
  required type for x: var string
  but expression '5' is of type: int literal(5)
proc add[T](x: var seq[T]; y: openArray[T])
  first type mismatch at position: 1
  required type for x: var seq[T]
  but expression '5' is of type: int literal(5)
proc add[T](x: var seq[T]; y: sink T)
  first type mismatch at position: 1
  required type for x: var seq[T]
  but expression '5' is of type: int literal(5)

expression: add(5, 5)
     Error: Execution failed with exit code 1
        ... Command: /usr/bin/nim js --noNimblePath -d:NimblePkgVersion=0.1.3 -r --path:. /home/moeller/git/nim-team/nim-d3/nim-d3-0.1.3/tests/test1

This was observed with

$ nim --version|head -n2
Nim Compiler Version 1.4.0 [Linux: amd64]
Compiled at 2020-11-25
@nileshpatra nileshpatra linked a pull request Nov 11, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant