You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Christian Schulte <cs...@schulte.it> on 2016/11/22 00:21:28 UTC
Need to change a test case in 'maven-filtering'.
Hi,
I am currently working on
<https://issues.apache.org/jira/browse/MSHARED-599> and am running into
an issue. With the fix in place an existing test case will start
failing. Here is the issue:
Please take a look at the following line
edge.escape.hanging=\\
from
<http://svn.apache.org/viewvc/maven/shared/trunk/maven-filtering/src/test/units-files/edge-cases/expected-filtered.properties?view=markup>.
With the fix in place, I would need to change that to
edge.escape.hanging=\
because the input to the filter looks like:
edge.escape.hanging=\\
in
<http://svn.apache.org/viewvc/maven/shared/trunk/maven-filtering/src/test/units-files/edge-cases/filtered/filtered.properties?view=markup>
and that is an escaped escape string which would need to become '\'
after filtering. Can I just remove that test case? I expect it is
testing something isn't hanging from somewhere in the past? Well. Seems
it is testing that escaping the escape string does not make something
hang - but incorrectly.
Regards,
--
Christian
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Need to change a test case in 'maven-filtering'.
Posted by Christian Schulte <cs...@schulte.it>.
Am 11/22/16 um 20:40 schrieb Guillaume Bou�:
> Hi Christian,
>
> This test looks normal to me. When loading the properties, through load
> https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html#load-java.io.Reader-,
> the backslash indicates the line terminator, so it needs to be escaped,
> otherwise the method would (silently) ignore it (if it doesn't represent
> a valid escape sequence). So having
>
> edge.escape.hanging=\\
>
>
> in the properties file means that you'll read "\" for the
> "edge.escape.hanging" property on the Java side. So it's testing that a
> lone escape character doesn't cause any issues during filtering.
>
I am not questioning the way the properties are loaded. I am questioning
the filtering itself. If the input is '\\', that is an escaped escape
string. So the output needs to be '\' after filtering. It isn't because
the escape string cannot be escaped. That's the issue I am fixing. I
cannot fix that without changing that test case. Looking at this, there
are cases where escaping the escape string leads to different output
than before I don't know how to handle.
IN = '\\'
OUT = '\\'
That's the issue. This needs to look like
IN = '\\'
OUT = '\'
if the escape string is the backslash. There is this test case testing
that the escape string does not get escaped. That may be intentionally.
I don't know.
Regards,
--
Christian
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Need to change a test case in 'maven-filtering'.
Posted by Guillaume Boué <gu...@orange.fr>.
Hi Christian,
This test looks normal to me. When loading the properties, through load
https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html#load-java.io.Reader-,
the backslash indicates the line terminator, so it needs to be escaped,
otherwise the method would (silently) ignore it (if it doesn't represent
a valid escape sequence). So having
edge.escape.hanging=\\
in the properties file means that you'll read "\" for the
"edge.escape.hanging" property on the Java side. So it's testing that a
lone escape character doesn't cause any issues during filtering.
Guillaume
Le 22/11/2016 � 01:21, Christian Schulte a �crit :
> Hi,
>
> I am currently working on
> <https://issues.apache.org/jira/browse/MSHARED-599> and am running into
> an issue. With the fix in place an existing test case will start
> failing. Here is the issue:
>
> Please take a look at the following line
>
> edge.escape.hanging=\\
>
> from
>
> <http://svn.apache.org/viewvc/maven/shared/trunk/maven-filtering/src/test/units-files/edge-cases/expected-filtered.properties?view=markup>.
>
>
> With the fix in place, I would need to change that to
>
> edge.escape.hanging=\
>
> because the input to the filter looks like:
>
> edge.escape.hanging=\\
>
> in
> <http://svn.apache.org/viewvc/maven/shared/trunk/maven-filtering/src/test/units-files/edge-cases/filtered/filtered.properties?view=markup>
> and that is an escaped escape string which would need to become '\'
> after filtering. Can I just remove that test case? I expect it is
> testing something isn't hanging from somewhere in the past? Well. Seems
> it is testing that escaping the escape string does not make something
> hang - but incorrectly.
>
> Regards,
---
L'absence de virus dans ce courrier �lectronique a �t� v�rifi�e par le logiciel antivirus Avast.
https://www.avast.com/antivirus
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org