#!/usr/bin/ruby

#
## Testing the '!' mark
#

var str = "abcdefg";

str.sub!(/^\w/,'').sub!(/\w\z/,'').sub(/\w/, '') == "cdef" ||
    die "Error on naked method!\n";

str == 'bcdef' ||
    die "Error on: '!'\n";

#
## More testing
#

str = "Sidef is working...";
str.uc!.sub(/ .*/, '') == "SIDEF" ||
    die "Error on: ':' and '!'\n";

str.substr(-3) == '...' ||
    die "The string had changed!\n";

#
## All done!
#

say "** Test passed!";
