diff options
Diffstat (limited to 'lib/kernel')
-rw-r--r-- | lib/kernel/test/os_SUITE.erl | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/kernel/test/os_SUITE.erl b/lib/kernel/test/os_SUITE.erl index cfd475becf..d7f0463289 100644 --- a/lib/kernel/test/os_SUITE.erl +++ b/lib/kernel/test/os_SUITE.erl @@ -324,9 +324,17 @@ max_size_command(_Config) -> Res32768 = os:cmd("cat /dev/zero", #{ max_size => 32768 }), 32768 = length(Res32768), - ResHello = string:trim(os:cmd("echo hello", #{ max_size => 20 })), + ResHello = string_trim(os:cmd("echo hello", #{ max_size => 20 })), 5 = length(ResHello). +string_trim(S) -> + lists:reverse(string_trim_left(lists:reverse(string_trim_left(S)))). + +string_trim_left([C | T]) when C =:= $\s; C =:= $\n; C =:= $\t; C =:= $\r -> + string_trim_left(T); +string_trim_left(S) -> + S. + %% Test that the os:perf_counter api works as expected perf_counter_api(_Config) -> |