@@ -44,7 +44,7 @@ impl LineProtoTerm<'_> {
4444 Float ( v) => v. to_string ( ) ,
4545 SignedInteger ( v) => format ! ( "{}i" , v) ,
4646 UnsignedInteger ( v) => format ! ( "{}i" , v) ,
47- Text ( v) => format ! ( r#""{}""# , Self :: escape_any( v, & * SLASHES ) ) ,
47+ Text ( v) => format ! ( r#""{}""# , Self :: escape_any( v, & * QUOTES_SLASHES ) ) ,
4848 }
4949 }
5050
@@ -59,9 +59,9 @@ impl LineProtoTerm<'_> {
5959 }
6060 }
6161 . to_string ( ) ,
62- Float ( v) => format ! ( r#"" {}"" # , v. to_string ( ) ) ,
63- SignedInteger ( v) => format ! ( r#""{}" "# , v) ,
64- UnsignedInteger ( v) => format ! ( r#""{}" "# , v) ,
62+ Float ( v) => format ! ( r#"{}"# , v) ,
63+ SignedInteger ( v) => format ! ( r#"{} "# , v) ,
64+ UnsignedInteger ( v) => format ! ( r#"{} "# , v) ,
6565 Text ( v) => Self :: escape_any ( v, & * SLASHES ) ,
6666 }
6767 }
@@ -78,6 +78,11 @@ mod test {
7878
7979 #[ test]
8080 fn test ( ) {
81+ assert_eq ! ( TagValue ( & Type :: Boolean ( true ) ) . escape( ) , r#"true"# ) ;
82+ assert_eq ! ( TagValue ( & Type :: Float ( 1.8324f64 ) ) . escape( ) , r#"1.8324"# ) ;
83+ assert_eq ! ( TagValue ( & Type :: SignedInteger ( -1i64 ) ) . escape( ) , r#"-1"# ) ;
84+ assert_eq ! ( TagValue ( & Type :: UnsignedInteger ( 1u64 ) ) . escape( ) , r#"1"# ) ;
85+
8186 assert_eq ! (
8287 TagValue ( & Type :: Text ( "this is my special string" . into( ) ) ) . escape( ) ,
8388 r#"this\ is\ my\ special\ string"#
@@ -112,7 +117,7 @@ mod test {
112117 assert_eq ! ( FieldValue ( & Type :: Text ( "\" " . into( ) ) ) . escape( ) , r#""\"""# ) ;
113118 assert_eq ! (
114119 FieldValue ( & Type :: Text ( r#"locat"\ ,=ion"# . into( ) ) ) . escape( ) ,
115- r#""locat\"\\\ \,\ =ion""#
120+ r#""locat\"\\ , =ion""#
116121 ) ;
117122 }
118123
0 commit comments