Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
monticore
EmbeddedMontiArc
generators
MathPrettyPrinter
Commits
9cf8b662
Commit
9cf8b662
authored
Aug 23, 2019
by
Jean-Marc Ronck
Browse files
Fixes build after license change.
parent
4efb5cc9
Pipeline
#175323
passed with stages
in 2 minutes and 39 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/test/java/de/monticore/lang/monticar/mpp/montimath/HTMLMathPrettyPrinterTest.java
View file @
9cf8b662
...
@@ -13,6 +13,7 @@ import java.io.File;
...
@@ -13,6 +13,7 @@ import java.io.File;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.nio.file.Path
;
import
java.nio.file.Path
;
import
java.nio.file.Paths
;
import
java.nio.file.Paths
;
import
java.util.List
;
import
java.util.Optional
;
import
java.util.Optional
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
...
@@ -48,8 +49,11 @@ public class HTMLMathPrettyPrinterTest {
...
@@ -48,8 +49,11 @@ public class HTMLMathPrettyPrinterTest {
Log
.
info
(
message
,
"HTMLMathPrettyPrinterTest"
);
Log
.
info
(
message
,
"HTMLMathPrettyPrinterTest"
);
Optional
<
ASTMathCompilationUnit
>
astOptional
=
parser
.
parse
(
sourceModel
.
toString
());
List
<
String
>
sourceLines
=
FileUtils
.
readLines
(
sourceModel
,
"UTF-8"
);
String
input
=
FileUtils
.
readFileToString
(
targetModel
,
"UTF-8"
);
String
source
=
String
.
join
(
"\n"
,
sourceLines
.
subList
(
1
,
sourceLines
.
size
()));
Optional
<
ASTMathCompilationUnit
>
astOptional
=
parser
.
parse_String
(
source
);
List
<
String
>
targetLines
=
FileUtils
.
readLines
(
targetModel
,
"UTF-8"
);
String
input
=
String
.
join
(
"\n"
,
targetLines
.
subList
(
1
,
targetLines
.
size
()));
String
output
=
printer
.
prettyPrint
(
astOptional
.
get
());
String
output
=
printer
.
prettyPrint
(
astOptional
.
get
());
assertEquals
(
input
.
replaceAll
(
"\\R+"
,
"\n"
),
output
.
replaceAll
(
"\\R+"
,
"\n"
));
assertEquals
(
input
.
replaceAll
(
"\\R+"
,
"\n"
),
output
.
replaceAll
(
"\\R+"
,
"\n"
));
...
...
src/test/java/de/monticore/lang/monticar/mpp/montimath/MathPrettyPrinterTest.java
View file @
9cf8b662
...
@@ -13,6 +13,7 @@ import java.io.File;
...
@@ -13,6 +13,7 @@ import java.io.File;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.nio.file.Path
;
import
java.nio.file.Path
;
import
java.nio.file.Paths
;
import
java.nio.file.Paths
;
import
java.util.List
;
import
java.util.Optional
;
import
java.util.Optional
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
...
@@ -46,8 +47,11 @@ public class MathPrettyPrinterTest {
...
@@ -46,8 +47,11 @@ public class MathPrettyPrinterTest {
Log
.
info
(
message
,
"MathPrettyPrinterTest"
);
Log
.
info
(
message
,
"MathPrettyPrinterTest"
);
Optional
<
ASTMathCompilationUnit
>
astOptional
=
parser
.
parse
(
sourceModel
.
toString
());
List
<
String
>
sourceLines
=
FileUtils
.
readLines
(
sourceModel
,
"UTF-8"
);
String
input
=
FileUtils
.
readFileToString
(
targetModel
,
"UTF-8"
);
String
source
=
String
.
join
(
"\n"
,
sourceLines
.
subList
(
1
,
sourceLines
.
size
()));
Optional
<
ASTMathCompilationUnit
>
astOptional
=
parser
.
parse_String
(
source
);
List
<
String
>
targetLines
=
FileUtils
.
readLines
(
targetModel
,
"UTF-8"
);
String
input
=
String
.
join
(
"\n"
,
targetLines
.
subList
(
1
,
targetLines
.
size
()));
String
output
=
printer
.
prettyPrint
(
astOptional
.
get
());
String
output
=
printer
.
prettyPrint
(
astOptional
.
get
());
assertEquals
(
input
.
replaceAll
(
"\\R+"
,
"\n"
),
output
.
replaceAll
(
"\\R+"
,
"\n"
));
assertEquals
(
input
.
replaceAll
(
"\\R+"
,
"\n"
),
output
.
replaceAll
(
"\\R+"
,
"\n"
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment