Skip to content

Commit 9eb84d0

Browse files
Copilotadamnfish
andcommitted
Add test for inline comments to verify correct parsing
Co-authored-by: adamnfish <29761+adamnfish@users.noreply.github.com>
1 parent 77e8ce3 commit 9eb84d0

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

core/src/test/scala/com/gu/devenv/ConfigTest.scala

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,27 @@ class ConfigTest
138138
"dotfiles" as None
139139
)
140140
}
141+
142+
"parses a user config file with inline comments" in {
143+
val configWithInlineComments = """plugins: # User plugins
144+
| intellij:
145+
| - "com.example.plugin" # Example plugin
146+
| vscode:
147+
| - "example.vscode-plugin"
148+
|""".stripMargin
149+
val Success(userConfig) =
150+
Config.parseUserConfig(configWithInlineComments).success
151+
152+
userConfig should have(
153+
"plugins" as Some(
154+
Plugins(
155+
List("com.example.plugin"),
156+
List("example.vscode-plugin")
157+
)
158+
),
159+
"dotfiles" as None
160+
)
161+
}
141162
}
142163

143164
"mergeConfigs" - {

0 commit comments

Comments
 (0)