Add unit tests for truncate filter function