blob: 8573a4c01a508aac143d0f43b6e119b62019793c [file] [log] [blame]
package org.codehaus.groovy.tools
import static org.codehaus.groovy.tools.StringHelper.*
class StringHelperTest extends GroovyTestCase {
void testTokenize() {
assert tokenizeUnquoted("a b") == ["a","b"]
assert tokenizeUnquoted("a 'b a'") == ["a","'b a'"]
assert tokenizeUnquoted(" a 'b a'") == ["a","'b a'"]
assert tokenizeUnquoted(" a 'b a'" ) == ["a","'b a'"]
assert tokenizeUnquoted('a "b a"') == ["a",'"b a"']
assert tokenizeUnquoted("a 'b \"a c\"'") == ["a","'b \"a c\"'"]
assert tokenizeUnquoted("a \"b 'a c'\"") == ["a","\"b 'a c'\""]
assert tokenizeUnquoted("'a ") == ["'a "]
assert tokenizeUnquoted("\"a 'b'") == ["\"a 'b'"]
}
}