switched to TRIM_SPACE comparison; added simple test for it