Debian Codegraph @

src/escape/test.rs

raw symbols SCIP
1 use craterust-analyzer cargo postgres-protocol 0.6.12 crate/::escaperust-analyzer cargo postgres-protocol 0.6.12 escape/::{escape_identifierrust-analyzer cargo postgres-protocol 0.6.12 escape/escape_identifier()., escape_literalrust-analyzer cargo postgres-protocol 0.6.12 escape/escape_literal().};
2
3 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
4 fn test_escape_idenifierrust-analyzer cargo postgres-protocol 0.6.12 escape/test/test_escape_idenifier().() {
5 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(escape_identifierrust-analyzer cargo postgres-protocol 0.6.12 escape/escape_identifier().("foo"), Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::fromrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][`From<&str>`]from().("\"foo\""));
6 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(escape_identifierrust-analyzer cargo postgres-protocol 0.6.12 escape/escape_identifier().("f\\oo"), Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::fromrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][`From<&str>`]from().("\"f\\oo\""));
7 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(escape_identifierrust-analyzer cargo postgres-protocol 0.6.12 escape/escape_identifier().("f'oo"), Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::fromrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][`From<&str>`]from().("\"f'oo\""));
8 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(escape_identifierrust-analyzer cargo postgres-protocol 0.6.12 escape/escape_identifier().("f\"oo"), Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::fromrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][`From<&str>`]from().("\"f\"\"oo\""));
9 }
10
11 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
12 fn test_escape_literalrust-analyzer cargo postgres-protocol 0.6.12 escape/test/test_escape_literal().() {
13 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(escape_literalrust-analyzer cargo postgres-protocol 0.6.12 escape/escape_literal().("foo"), Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::fromrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][`From<&str>`]from().("'foo'"));
14 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(escape_literalrust-analyzer cargo postgres-protocol 0.6.12 escape/escape_literal().("f\\oo"), Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::fromrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][`From<&str>`]from().(" E'f\\\\oo'"));
15 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(escape_literalrust-analyzer cargo postgres-protocol 0.6.12 escape/escape_literal().("f'oo"), Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::fromrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][`From<&str>`]from().("'f''oo'"));
16 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(escape_literalrust-analyzer cargo postgres-protocol 0.6.12 escape/escape_literal().("f\"oo"), Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::fromrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][`From<&str>`]from().("'f\"oo'"));
17 }