|
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 | | - 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 |
| 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) |
20 | 23 | ), |
21 | | - ( close(Out2), |
22 | | - close(Out1) ) |
| 24 | + close(Out1) |
23 | 25 | ) |
24 | 26 | )). |
25 | 27 |
|
|
28 | 30 | atom_chars('/bin/echo', Echo), |
29 | 31 | atom_chars('Testing', Content), |
30 | 32 | iso_ext:setup_call_cleanup( |
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" |
| 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) |
40 | 45 | ), |
41 | | - ( close(Out2), |
42 | | - close(Out1) ) |
| 46 | + close(Out1) |
43 | 47 | ) |
44 | 48 | )). |
45 | 49 |
|
|
48 | 52 | atom_chars('/bin/echo', Echo), |
49 | 53 | atom_chars('NegativeTest', Content), |
50 | 54 | iso_ext:setup_call_cleanup( |
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 |
| 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) |
58 | 65 | ), |
59 | | - ( close(Out2), |
60 | | - close(Out1) ) |
| 66 | + close(Out1) |
61 | 67 | ) |
62 | 68 | )). |
63 | 69 |
|
|
0 commit comments