Problems upgrading to Chisel 3.5.x and AnyFlatSpec vs. FlatSpec

48 views
Skip to first unread message

Øyvind Harboe

unread,
May 21, 2021, 7:29:29 AM5/21/21
to chisel-users
So it appears that I now need to search and replace FlatSpec with AnyFlatSpec, because FlatSpec no longer exists...

What is the difference between AnyFlatSpec and FlatSpec?

import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers

class DooHingyTests extends AnyFlatSpec with ChiselScalatestTester with Matchers 

Schuyler Eldridge

unread,
May 21, 2021, 9:50:29 AM5/21/21
to chisel...@googlegroups.com
There's no change as far as I understand it.

ScalaTest made this change in 3.1.0 because they wanted to re-use the FlatSpec (FunSpec, etc.) names for new testing methods that would return assertions. I'm not 100% sure on all the changes, but AnyFlatSpec is an exact replacement for the old FlatSpec where the return type is Any.

There's some more info in the release notes for 3.1.0 (including multiple tables that show the old and new names) as well as Scalafix stuff they provide that may do the renames/upgrade for you:

- https://www.scalatest.org/release_notes/3.1.0

Sorry about that. Naming is apparently hard for other projects, too. :)

Øyvind Harboe

unread,
May 21, 2021, 11:46:48 AM5/21/21
to chisel-users
Perhaps a good thing to note in the release notes of Chisel 3.5?


Thanks!
Reply all
Reply to author
Forward
0 new messages