WARNING! Access to this system is limited to authorised users only.
Unauthorised users may be subject to prosecution.
Unauthorised access to this system is a criminal offence under Australian law (Federal Crimes Act 1914 Part VIA)
It is a criminal offence to:
(1) Obtain access to data without authority. -Penalty 2 years imprisonment.
(2) Damage, delete, alter or insert data without authority. -Penalty 10 years imprisonment.
User activity is monitored and recorded. Anyone using this system expressly consents to such monitoring and recording.

To protect your data, the CISO officer has suggested users to enable 2FA as soon as possible.
Currently 2.7% of users enabled 2FA.

NicerErrorMessage.scala 803 Bytes
Newer Older
1
2
3
4
5
package uvm.ir.textinput

import org.scalatest.FlatSpec
import org.scalatest.Matchers

Kunshan Wang's avatar
Kunshan Wang committed
6
7
import uvm.GlobalBundle
import uvm.TrantientBundle
8
9
10
11

class NicerErrorMessage extends FlatSpec with Matchers
  with TestingBundlesValidators {

Kunshan Wang's avatar
Kunshan Wang committed
12
  def parseFile(fileName: String, globalBundle: GlobalBundle, fac: Option[IDFactory] = None): TrantientBundle = {
13
14
15
16
17
18
19
20
21
22
    val idf = fac.getOrElse(new IDFactory())
    val r = new UIRTextReader(idf)
    val ir = r.read(new java.io.FileReader(fileName), globalBundle)
    ir
  }

  behavior of "UIRTextReader"

  it should "give nice error messages" in {
    try {
Kunshan Wang's avatar
Kunshan Wang committed
23
24
      val gb = new GlobalBundle()
      val b = parseFile("tests/uvm-parsing-test/bundle-with-error.uir", gb)
25
26
27
28
29
30
    } catch {
      case e: TextIRParsingException => // expected
        e.printStackTrace()
    }
  }
}