428 | def test_chomp(self, space): |
429 | assert space.str_w(space.execute('return "hello".chomp')) == "hello" |
430 | assert space.str_w(space.execute('return "hello\\n".chomp')) == "hello" |
431 | assert space.str_w(space.execute('return "hello\\r\\n".chomp')) == "hello" |
432 | assert space.str_w(space.execute('return "hello\\n\\r".chomp')) == "hello" |
433 | assert space.str_w(space.execute('return "hello\\r".chomp')) == "hello" |
434 | assert space.str_w(space.execute('return "hello \\n there".chomp')) == "hello \n there" |
435 | assert space.str_w(space.execute('return "hello".chomp("llo")')) == "he" |
436 | w_res = space.execute('return "hello".chomp!') |
437 | assert w_res is space.w_nil |
438 | w_res = space.execute('return "".chomp!') |
439 | assert w_res is space.w_nil |