Debian Codegraph @

src/osstring_tests.rs

raw symbols SCIP
1 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::ffirust-analyzer cargo std https://github.com/rust-lang/rust/library/std ffi/::OsStringrust-analyzer cargo std https://github.com/rust-lang/rust/library/std ffi/os_str/OsString#;
2
3 use craterust-analyzer cargo swrite 0.1.0 crate/::{swriterust-analyzer cargo swrite 0.1.0 swrite!, swritelnrust-analyzer cargo swrite 0.1.0 swriteln!, SWriterust-analyzer cargo swrite 0.1.0 SWrite#};
4
5 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
6 fn test_swriterust-analyzer cargo swrite 0.1.0 osstring_tests/test_swrite().() {
7 let mut buf = OsStringrust-analyzer cargo std https://github.com/rust-lang/rust/library/std ffi/os_str/OsString#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std ffi/os_str/impl#[OsString]new().();
8 swriterust-analyzer cargo swrite 0.1.0 swrite!!(buf, "Hello, {}!", "world");
9 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(buf, "Hello, world!");
10 }
11
12 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
13 fn test_swritelnrust-analyzer cargo swrite 0.1.0 osstring_tests/test_swriteln().() {
14 let mut buf = OsStringrust-analyzer cargo std https://github.com/rust-lang/rust/library/std ffi/os_str/OsString#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std ffi/os_str/impl#[OsString]new().();
15 swritelnrust-analyzer cargo swrite 0.1.0 swriteln!!(buf, "Hello, {}!", "world");
16 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(buf, "Hello, world!\n");
17 }
18
19 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
20 fn test_swriteln_appendsrust-analyzer cargo swrite 0.1.0 osstring_tests/test_swriteln_appends().() {
21 let mut buf = OsStringrust-analyzer cargo std https://github.com/rust-lang/rust/library/std ffi/os_str/OsString#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std ffi/os_str/impl#[OsString]new().();
22 swriterust-analyzer cargo swrite 0.1.0 swrite!!(buf, "Hello, {}", "world");
23 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(buf, "Hello, world");
24 swritelnrust-analyzer cargo swrite 0.1.0 swriteln!!(buf, "!");
25 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(buf, "Hello, world!\n");
26 }
27
28 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
29 fn test_swriteln_emptyrust-analyzer cargo swrite 0.1.0 osstring_tests/test_swriteln_empty().() {
30 let mut buf = OsStringrust-analyzer cargo std https://github.com/rust-lang/rust/library/std ffi/os_str/OsString#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std ffi/os_str/impl#[OsString]new().();
31 swritelnrust-analyzer cargo swrite 0.1.0 swriteln!!(buf);
32 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(buf, "\n");
33 let mut buf = OsStringrust-analyzer cargo std https://github.com/rust-lang/rust/library/std ffi/os_str/OsString#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std ffi/os_str/impl#[OsString]new().();
34 swritelnrust-analyzer cargo swrite 0.1.0 swriteln!!(buf,);
35 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(buf, "\n");
36 }