@@ -5,16 +5,27 @@ Resource process_resource.robot
5
5
Trailing newline is removed
6
6
${result } = Run Process python -c import sys; sys.stdout.write('nothing to remove')
7
7
Result should equal ${result } stdout=nothing to remove
8
- ${result } = Run Process python -c import sys; sys.stdout.write('one is removed\\n')
9
- Result should equal ${result } stdout=one is removed
8
+ ${result } = Run Process python -c import sys; sys.stdout.write('removed\\n')
9
+ Result should equal ${result } stdout=removed
10
10
${result } = Run Process python -c import sys; sys.stdout.write('only one is removed\\n\\n\\n')
11
11
Result should equal ${result } stdout=only one is removed\n\n
12
12
13
13
Internal newlines are preserved
14
- ${result } = Run Process python -c print ('1\\n2\\n3')
14
+ ${result } = Run Process python -c import sys; sys.stdout.write ('1\\n2\\n3\\n ')
15
15
Result should equal ${result } stdout=1\n2\n3
16
16
17
+ CRLF is converted to LF
18
+ ${result } = Run Process python -c import sys; sys.stdout.write('1\\r\\n2\\r3\\n4')
19
+ # On Windows \r\n is turned \r\r\n when writing and thus the result is \r\n.
20
+ # Elsewhere \r\n is not changed when writing and thus the result is \n.
21
+ # ${\n} is \r\n or \n depending on the OS and thus works as the expected result.
22
+ Result should equal ${result } stdout=1${\n } 2 \r3\n4
23
+
17
24
Newlines with custom stream
18
- ${result } = Run Process python -c print('1\\n2\\n3') stdout=${STDOUT }
19
- Result should equal ${result } stdout=1\n2\n3 stdout_path=${STDOUT }
25
+ ${result } = Run Process python -c import sys; sys.stdout.write('1\\n2\\n3\\n')
26
+ Result should equal ${result } stdout=1\n2\n3
27
+ ${result } = Run Process python -c import sys; sys.stdout.write('1\\n2\\r\\n3\\n') stdout=${STDOUT }
28
+ Result should equal ${result } stdout=1\n2${\n } 3 stdout_path=${STDOUT }
29
+ ${output } = Get Binary File ${STDOUT }
30
+ Should Be Equal ${output } 1 ${\n } 2 \r${\n } 3 ${\n } type=bytes
20
31
[Teardown] Safe Remove File ${STDOUT }
0 commit comments