scalatest - Testing in Scala -


i new scala , jvm in general.

there statement in book:

to provide descriptive error messages when assertions fail, scalatest analyses expressions passed each assert invocation at compile time.

which confused me lot.

what mean? how can scalatest access compile time information?

scala supports macros enable kind of features. scala macro can analyze syntax tree @ call site , extract useful information it. libraries scalatest use macros obtain information call site provide e.g. error messages based on variable names.


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -