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
0224ded9
Commit
0224ded9
authored
Aug 23, 2019
by
Jean-Marc Ronck
Browse files
Merge branch 'fix-build' into 'master'
Fix Build after second License Change See merge request
!14
parents
5cdbff29
9cf8b662
Pipeline
#175479
passed with stages
in 3 minutes and 10 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
pom.xml
View file @
0224ded9
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
<groupId>
de.monticore.lang.monticar
</groupId>
<groupId>
de.monticore.lang.monticar
</groupId>
<artifactId>
math-pretty-printer
</artifactId>
<artifactId>
math-pretty-printer
</artifactId>
<version>
0.3.
2
-SNAPSHOT
</version>
<version>
0.3.
3
-SNAPSHOT
</version>
<properties>
<properties>
...
...
src/test/java/de/monticore/lang/monticar/mpp/montimath/HTMLMathPrettyPrinterTest.java
View file @
0224ded9
...
@@ -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 @
0224ded9
...
@@ -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