| 1 | extern crate swriterust-analyzer cargo swrite 0.1.0 swrite/; |
| 2 | use swriterust-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#}; |
| 3 | |
| 4 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 5 | fn test_swriterust-analyzer cargo swrite 0.1.0 test_swrite().() { |
| 6 | let mut buf = Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]new().(); |
| 7 | swriterust-analyzer cargo swrite 0.1.0 swrite!!(buf, "Hello, {}!", "world"); |
| 8 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(buf, "Hello, world!"); |
| 9 | } |
| 10 | |
| 11 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 12 | fn test_swritelnrust-analyzer cargo swrite 0.1.0 test_swriteln().() { |
| 13 | let mut buf = Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]new().(); |
| 14 | swritelnrust-analyzer cargo swrite 0.1.0 swriteln!!(buf, "Hello, {}!", "world"); |
| 15 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(buf, "Hello, world!\n"); |
| 16 | } |
| 17 | |
| 18 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 19 | fn test_swriteln_appendsrust-analyzer cargo swrite 0.1.0 test_swriteln_appends().() { |
| 20 | let mut buf = Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]new().(); |
| 21 | swriterust-analyzer cargo swrite 0.1.0 swrite!!(buf, "Hello, {}", "world"); |
| 22 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(buf, "Hello, world"); |
| 23 | swritelnrust-analyzer cargo swrite 0.1.0 swriteln!!(buf, "!"); |
| 24 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(buf, "Hello, world!\n"); |
| 25 | } |
| 26 | |
| 27 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 28 | fn test_swriteln_emptyrust-analyzer cargo swrite 0.1.0 test_swriteln_empty().() { |
| 29 | let mut buf = Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]new().(); |
| 30 | swritelnrust-analyzer cargo swrite 0.1.0 swriteln!!(buf); |
| 31 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(buf, "\n"); |
| 32 | let mut buf = Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]new().(); |
| 33 | swritelnrust-analyzer cargo swrite 0.1.0 swriteln!!(buf,); |
| 34 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(buf, "\n"); |
| 35 | } |
| 36 | |
| 37 | mod qualifiedrust-analyzer cargo swrite 0.1.0 qualified/ { |
| 38 | use swriterust-analyzer cargo swrite 0.1.0 crate/::SWriterust-analyzer cargo swrite 0.1.0 SWrite#; |
| 39 | |
| 40 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 41 | fn test_swriterust-analyzer cargo swrite 0.1.0 qualified/test_swrite().() { |
| 42 | let mut buf = Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]new().(); |
| 43 | swriterust-analyzer cargo swrite 0.1.0 crate/::swriterust-analyzer cargo swrite 0.1.0 swrite!!(buf, "Hello, {}!", "world"); |
| 44 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(buf, "Hello, world!"); |
| 45 | } |
| 46 | |
| 47 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 48 | fn test_swritelnrust-analyzer cargo swrite 0.1.0 qualified/test_swriteln().() { |
| 49 | let mut buf = Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]new().(); |
| 50 | swriterust-analyzer cargo swrite 0.1.0 crate/::swritelnrust-analyzer cargo swrite 0.1.0 swriteln!!(buf, "Hello, {}!", "world"); |
| 51 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(buf, "Hello, world!\n"); |
| 52 | } |
| 53 | |
| 54 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 55 | fn test_swriteln_appendsrust-analyzer cargo swrite 0.1.0 qualified/test_swriteln_appends().() { |
| 56 | let mut buf = Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]new().(); |
| 57 | swriterust-analyzer cargo swrite 0.1.0 crate/::swriterust-analyzer cargo swrite 0.1.0 swrite!!(buf, "Hello, {}", "world"); |
| 58 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(buf, "Hello, world"); |
| 59 | swriterust-analyzer cargo swrite 0.1.0 crate/::swritelnrust-analyzer cargo swrite 0.1.0 swriteln!!(buf, "!"); |
| 60 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(buf, "Hello, world!\n"); |
| 61 | } |
| 62 | |
| 63 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 64 | fn test_swriteln_emptyrust-analyzer cargo swrite 0.1.0 qualified/test_swriteln_empty().() { |
| 65 | let mut buf = Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]new().(); |
| 66 | swriterust-analyzer cargo swrite 0.1.0 crate/::swritelnrust-analyzer cargo swrite 0.1.0 swriteln!!(buf); |
| 67 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(buf, "\n"); |
| 68 | let mut buf = Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]new().(); |
| 69 | swriterust-analyzer cargo swrite 0.1.0 crate/::swritelnrust-analyzer cargo swrite 0.1.0 swriteln!!(buf,); |
| 70 | assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(buf, "\n"); |
| 71 | } |
| 72 | } |