|
11 | 11 | atom_chars('/bin/echo', Echo), |
12 | 12 | atom_chars('ABCDEFGHIJ', Content), |
13 | 13 | iso_ext:setup_call_cleanup( |
14 | | - process:process_create(Echo, [Content], [stdout(pipe(Out1))]), |
15 | | - iso_ext:setup_call_cleanup( |
16 | | - process:process_create(Echo, [Content], [stdout(pipe(Out2))]), |
17 | | - ( |
18 | | - charsio:get_n_chars(Out1, 5, Chars1), |
19 | | - charsio:get_n_chars(Out2, 5, Chars2, 0), |
20 | | - Chars1 = Chars2 |
21 | | - ), |
22 | | - close(Out2) |
| 14 | + ( process:process_create(Echo, [Content], [stdout(pipe(Out1))]), |
| 15 | + process:process_create(Echo, [Content], [stdout(pipe(Out2))]) ), |
| 16 | + ( |
| 17 | + charsio:get_n_chars(Out1, 5, Chars1), |
| 18 | + charsio:get_n_chars(Out2, 5, Chars2, 0), |
| 19 | + Chars1 = Chars2 |
23 | 20 | ), |
24 | | - close(Out1) |
| 21 | + ( close(Out2), |
| 22 | + close(Out1) ) |
25 | 23 | ) |
26 | 24 | )). |
27 | 25 |
|
|
30 | 28 | atom_chars('/bin/echo', Echo), |
31 | 29 | atom_chars('Testing', Content), |
32 | 30 | iso_ext:setup_call_cleanup( |
33 | | - process:process_create(Echo, [Content], [stdout(pipe(Out1))]), |
34 | | - iso_ext:setup_call_cleanup( |
35 | | - process:process_create(Echo, [Content], [stdout(pipe(Out2))]), |
36 | | - ( |
37 | | - charsio:get_n_chars(Out1, N1, Chars1), |
38 | | - charsio:get_n_chars(Out2, N2, Chars2, 0), |
39 | | - N1 = N2, |
40 | | - Chars1 = Chars2, |
41 | | - N1 = 8, |
42 | | - Chars1 = "Testing\n" |
43 | | - ), |
44 | | - close(Out2) |
| 31 | + ( process:process_create(Echo, [Content], [stdout(pipe(Out1))]), |
| 32 | + process:process_create(Echo, [Content], [stdout(pipe(Out2))]) ), |
| 33 | + ( |
| 34 | + charsio:get_n_chars(Out1, N1, Chars1), |
| 35 | + charsio:get_n_chars(Out2, N2, Chars2, 0), |
| 36 | + N1 = N2, |
| 37 | + Chars1 = Chars2, |
| 38 | + N1 = 8, |
| 39 | + Chars1 = "Testing\n" |
45 | 40 | ), |
46 | | - close(Out1) |
| 41 | + ( close(Out2), |
| 42 | + close(Out1) ) |
47 | 43 | ) |
48 | 44 | )). |
49 | 45 |
|
|
52 | 48 | atom_chars('/bin/echo', Echo), |
53 | 49 | atom_chars('NegativeTest', Content), |
54 | 50 | iso_ext:setup_call_cleanup( |
55 | | - process:process_create(Echo, [Content], [stdout(pipe(Out1))]), |
56 | | - iso_ext:setup_call_cleanup( |
57 | | - process:process_create(Echo, [Content], [stdout(pipe(Out2))]), |
58 | | - ( |
59 | | - charsio:get_n_chars(Out1, N1, Chars1), |
60 | | - charsio:get_n_chars(Out2, N2, Chars2, -100), |
61 | | - N1 = N2, |
62 | | - Chars1 = Chars2 |
63 | | - ), |
64 | | - close(Out2) |
| 51 | + ( process:process_create(Echo, [Content], [stdout(pipe(Out1))]), |
| 52 | + process:process_create(Echo, [Content], [stdout(pipe(Out2))]) ), |
| 53 | + ( |
| 54 | + charsio:get_n_chars(Out1, N1, Chars1), |
| 55 | + charsio:get_n_chars(Out2, N2, Chars2, -100), |
| 56 | + N1 = N2, |
| 57 | + Chars1 = Chars2 |
65 | 58 | ), |
66 | | - close(Out1) |
| 59 | + ( close(Out2), |
| 60 | + close(Out1) ) |
67 | 61 | ) |
68 | 62 | )). |
69 | 63 |
|
|
0 commit comments