From ac4e3ca19246ae3d983f99607b865c5ed3acb2b9 Mon Sep 17 00:00:00 2001 From: James Iry Date: Tue, 4 Jun 2013 10:22:43 -0700 Subject: Refactor testing logic for only running under certain JDK versions We had several tests designed to only run if the JDK version was at least some specified version. This commit refactors that common logic into DirectTest. --- test/files/run/classfile-format-51.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test/files/run/classfile-format-51.scala') diff --git a/test/files/run/classfile-format-51.scala b/test/files/run/classfile-format-51.scala index 9b1e612f4f..378caa7936 100644 --- a/test/files/run/classfile-format-51.scala +++ b/test/files/run/classfile-format-51.scala @@ -112,12 +112,12 @@ object Driver { System.setErr(System.out) try { // this test is only valid under JDK 1.7+ - // cheat a little by using 'ScalaVersion' because it can parse java versions just as well - val requiredJavaVersion = ScalaVersion("1.7") - val executingJavaVersion = ScalaVersion(System.getProperty("java.specification.version")) - if (executingJavaVersion >= requiredJavaVersion) { + testUnderJavaAtLeast("1.7") { generateClass() compile() + () + } otherwise { + () } } finally -- cgit v1.2.3