summaryrefslogtreecommitdiff
path: root/src/test/scala/chiselTests/util/BitPatSpec.scala
blob: a6c0acf769c725a5cbf8a151de82ad9ead8b5c4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// SPDX-License-Identifier: Apache-2.0

package chiselTests.util

import chisel3.util.BitPat
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers


class BitPatSpec extends AnyFlatSpec with Matchers {
  behavior of classOf[BitPat].toString

  it should "convert a BitPat to readable form" in {
    val testPattern = "0" * 32 + "1" * 32 + "?" * 32 + "?01" * 32
    BitPat("b" + testPattern).toString should be (s"BitPat($testPattern)")
  }
}