From 66df06dac14230931fb793d4b2e49f8fc948c3d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vincent=20Membr=C3=A9?= Date: Fri, 6 Dec 2019 10:05:20 +0100 Subject: [PATCH] Fixes #16357: Broken test on whitespace matching and regex is invalid for multiline --- .../src/main/scala/com/normation/rudder/ncf/Technique.scala | 5 +++-- .../com/normation/rudder/ncf/TestTechniqueWriter.scala | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/webapp/sources/rudder/rudder-core/src/main/scala/com/normation/rudder/ncf/Technique.scala b/webapp/sources/rudder/rudder-core/src/main/scala/com/normation/rudder/ncf/Technique.scala index 464df879118..a6e6c640f39 100644 --- a/webapp/sources/rudder/rudder-core/src/main/scala/com/normation/rudder/ncf/Technique.scala +++ b/webapp/sources/rudder/rudder-core/src/main/scala/com/normation/rudder/ncf/Technique.scala @@ -37,9 +37,10 @@ package com.normation.rudder.ncf +import java.util.regex.Pattern + import com.normation.errors.PureResult import com.normation.errors.Unexpected - import cats.data.NonEmptyList import com.normation.inventory.domain.Version import com.normation.inventory.domain.AgentType @@ -202,7 +203,7 @@ object Constraint { case object NoWhiteSpace extends Constraint { def check(value: String): CheckResult = { - if (value.matches("""^(?!\s).*(?