File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
test/Microsoft.OpenApi.Readers.Tests Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -282,6 +282,31 @@ public void BooleanPropertyNamesShouldRemainStringsFromYaml()
282282 // Then
283283 Assert . Equal ( yamlInput . MakeLineBreaksEnvironmentNeutral ( ) , convertedBackOutput . MakeLineBreaksEnvironmentNeutral ( ) ) ;
284284 }
285+
286+ [ Fact ]
287+ public void LineBreaksShouldRoundTrip ( )
288+ {
289+ var yamlInput =
290+ """
291+ python: |-
292+ from openai import OpenAI
293+
294+ client = OpenAI(
295+ api_key="My API Key",
296+ )
297+ page = client.beta.assistants.list()
298+ page = page.data[0]
299+ print(page.id)
300+ """ ;
301+ // When
302+ var jsonNode = ConvertYamlStringToJsonNode ( yamlInput ) ;
303+ var convertedBack = jsonNode . ToYamlNode ( ) ;
304+ var convertedBackOutput = ConvertYamlNodeToString ( convertedBack ) ;
305+
306+ // Then
307+ Assert . Equal ( yamlInput . MakeLineBreaksEnvironmentNeutral ( ) , convertedBackOutput . MakeLineBreaksEnvironmentNeutral ( ) ) ;
308+ }
309+
285310 private static JsonNode ConvertYamlStringToJsonNode ( string yamlInput )
286311 {
287312 var yamlDocument = new YamlStream ( ) ;
You can’t perform that action at this time.
0 commit comments