Skip to content

Commit

Permalink
Fixed tests expectation for Windows. Set encoding for diagram project.
Browse files Browse the repository at this point in the history
  • Loading branch information
dhuebner committed Nov 27, 2023
1 parent 6152ebd commit da7e53a
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,9 @@ private void processChildren(Statement statement, HasStatements parent, FeatureE
child = new ElementData((SchemaNode) ele, ElementKind.Grouping);
} else if (ele instanceof Uses) {
/*
* The effect of a uses reference to a grouping is that the nodes defined by
* The effect of a "uses" reference to a grouping is that the nodes defined by
* the grouping are copied into the current schema tree and are then updated
* according to the refine and augment statements.
* according to the "refine" and "augment" statements.
*/
GroupingRef groupingRef = ((Uses) ele).getGrouping();
Grouping grouping = groupingRef.getNode();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import org.eclipse.xtext.resource.SaveOptions
import org.eclipse.xtext.resource.XtextResource
import org.eclipse.xtext.util.EmfFormatter
import org.junit.Test
import static extension org.eclipse.xtext.util.Strings.toPlatformLineSeparator

import static org.junit.Assert.assertEquals

Expand Down Expand Up @@ -101,7 +102,7 @@ class Bug224Test extends AbstractYangTest {
}
}'''
assertEquals(expectedResolvedPath,
EmfFormatter.objToStr((augmentsLeafType.substatements.head as Path).reference))
EmfFormatter.objToStr((augmentsLeafType.substatements.head as Path).reference).toPlatformLineSeparator)

val serializer = (sub2Res as XtextResource).getSerializer();
val result = serializer.serialize(submodule2, SaveOptions.newBuilder().format().getOptions())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import org.eclipse.xtext.resource.SaveOptions
import org.eclipse.xtext.resource.XtextResource
import org.eclipse.xtext.util.EmfFormatter
import org.junit.Test

import static extension org.eclipse.xtext.util.Strings.toPlatformLineSeparator
import static org.junit.Assert.assertEquals

class Bug225Test extends AbstractYangTest {
Expand Down Expand Up @@ -129,7 +129,7 @@ class Bug225Test extends AbstractYangTest {
}
}'''
assertEquals(expectedResolvedPath,
EmfFormatter.objToStr((augmentsLeafType.substatements.head as Path).reference))
EmfFormatter.objToStr((augmentsLeafType.substatements.head as Path).reference).toPlatformLineSeparator)

val result = serializer.serialize(submodule2, SaveOptions.newBuilder().format().getOptions())
assertEquals('''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import io.typefox.yang.tests.AbstractYangTest
import io.typefox.yang.yang.Contact
import io.typefox.yang.yang.Container
import io.typefox.yang.yang.Description
import io.typefox.yang.yang.Grouping
import io.typefox.yang.yang.KeyReference
import io.typefox.yang.yang.Leaf
import io.typefox.yang.yang.List
Expand Down Expand Up @@ -414,7 +413,7 @@ class SerializationTest extends AbstractYangTest {
resource.assertNoErrors()
val module = resource.contents.head as Module
val uses = module.substatements.get(4).substatements.get(2).substatements.get(1) as Uses
assertTrue(uses.grouping.node instanceof Grouping)
assertNotNull(uses.grouping.node)
assertFalse((uses.grouping.node as InternalEObject).eIsProxy)

val serialized = resource.serializer.serialize(resource.contents.head)
Expand Down

0 comments on commit da7e53a

Please sign in to comment.