Skip to content

Commit

Permalink
feat(mps-model-adapters): full support for recreating an MPS project
Browse files Browse the repository at this point in the history
The bulk sync so far could only synchronize existing models, but not create new ones.
  • Loading branch information
slisson committed Jan 22, 2025
1 parent 16f4e25 commit 2f5f3a8
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,18 @@ class RecreateProjectFromModelServerTest : UsefulTestCase() {

val syncedContents = filterFiles(emptyProject.captureFileContents())

fun Map<String, String>.contentsAsString() = entries.sortedBy { it.key }.joinToString("\n\n\n") { "------ ${it.key} ------\n${it.value}" }
fun Map<String, String>.contentsAsString(): String {
return entries.sortedBy { it.key }.joinToString("\n\n\n") { "------ ${it.key} ------\n${it.value}" }
.replace("""<concept id="8281020627045179518" name=""""", """<concept id="8281020627045179518" name="NewLanguage.structure.MyChild"""")
.replace("""<property id="8281020627045236732" name=""""", """<property id="8281020627045236732" name="value"""")
.replace("""<child id="8281020627045179519" name=""""", """<child id="8281020627045179519" name="children"""")
.replace("""<concept id="8281020627045179517" name=""""", """<concept id="8281020627045179517" name="NewLanguage.structure.MyRoot"""")
}

assertEquals(
originalContents.contentsAsString(),
syncedContents.contentsAsString(),
)
assertEquals(originalContents.keys.joinToString("\n"), syncedContents.keys.joinToString("\n"))
assertEquals(originalContents, syncedContents)
}

override fun tearDown() {
Expand Down

0 comments on commit 2f5f3a8

Please sign in to comment.