From b4c5ef59f54aca27a2e6a9f665b9d68f159c485f Mon Sep 17 00:00:00 2001 From: Guillaume Raffin Date: Sun, 23 Oct 2022 16:31:40 +0200 Subject: [PATCH] Add test, fix #15835 --- .../coverage/run/extend-case-class/test.check | 2 + .../coverage/run/extend-case-class/test.scala | 10 +++ .../extend-case-class/test.scoverage.check | 71 +++++++++++++++++++ 3 files changed, 83 insertions(+) create mode 100644 tests/coverage/run/extend-case-class/test.check create mode 100644 tests/coverage/run/extend-case-class/test.scala create mode 100644 tests/coverage/run/extend-case-class/test.scoverage.check diff --git a/tests/coverage/run/extend-case-class/test.check b/tests/coverage/run/extend-case-class/test.check new file mode 100644 index 000000000000..aa960ae5a323 --- /dev/null +++ b/tests/coverage/run/extend-case-class/test.check @@ -0,0 +1,2 @@ +1 +6178 \ No newline at end of file diff --git a/tests/coverage/run/extend-case-class/test.scala b/tests/coverage/run/extend-case-class/test.scala new file mode 100644 index 000000000000..be9c666b4f55 --- /dev/null +++ b/tests/coverage/run/extend-case-class/test.scala @@ -0,0 +1,10 @@ +// see issue 15835 +import java.math.MathContext +case class DecimalConf(mathContext: MathContext, scaleLimit: Int, digitsLimit: Int) +object DecimalConf extends DecimalConf(MathContext.UNLIMITED, 6178, 308) + +@main +def Test: Unit = + val c = DecimalConf(MathContext.DECIMAL32, 1, 0) + println(c.scaleLimit) + println(DecimalConf.scaleLimit) diff --git a/tests/coverage/run/extend-case-class/test.scoverage.check b/tests/coverage/run/extend-case-class/test.scoverage.check new file mode 100644 index 000000000000..69da960e4f6a --- /dev/null +++ b/tests/coverage/run/extend-case-class/test.scoverage.check @@ -0,0 +1,71 @@ +# Coverage data, format version: 3.0 +# Statement data: +# - id +# - source path +# - package name +# - class name +# - class type (Class, Object or Trait) +# - full class name +# - method name +# - start offset +# - end offset +# - line number +# - symbol name +# - tree name +# - is branch +# - invocations count +# - is ignored +# - description (can be multi-line) +# ' ' sign +# ------------------------------------------ +0 +extend-case-class/test.scala + +test$package$ +Object +.test$package$ +Test +282 +303 +8 +println +Apply +false +0 +false +println(c.scaleLimit) + +1 +extend-case-class/test.scala + +test$package$ +Object +.test$package$ +Test +306 +337 +9 +println +Apply +false +0 +false +println(DecimalConf.scaleLimit) + +2 +extend-case-class/test.scala + +test$package$ +Object +.test$package$ +Test +206 +220 +6 +Test +DefDef +false +0 +false +@main\ndef Test +