test(csv): test_csv_string.
// See the License for the specific language governing permissions and
// limitations under the License.
+use common_datavalues::serializations::write_csv_string;
use common_datavalues::serializations::write_escaped_string;
use common_datavalues::serializations::write_json_string;
use common_io::prelude::FormatSettings;
@@ -104,3 +105,13 @@ fn test_json_escape() {
assert_eq!(&buf, b"123\\u2028\\u2029abc")
}
}
+
+#[test]
+fn test_csv_string() {
+ {
+ let s = "a\"\nb";
+ let mut buf = vec![];
+ write_csv_string(s.as_bytes(), &mut buf, b'"');
+ assert_eq!(&buf, b"a\"\"\nb")
+ }
+}
