/src/test/rustdoc/playground.rs

https://gitlab.com/rust-lang/rust · Rust · 27 lines · 2 code · 3 blank · 22 comment · 0 complexity · 2aeb16ea2ed881ca5e540efe7d51164e MD5 · raw file

  1. #![crate_name = "foo"]
  2. #![doc(html_playground_url = "https://www.example.com/")]
  3. //! module docs
  4. //!
  5. //! ```
  6. //! println!("Hello, world!");
  7. //! ```
  8. //!
  9. //! ```
  10. //! fn main() {
  11. //! println!("Hello, world!");
  12. //! }
  13. //! ```
  14. //!
  15. //! ```
  16. //! #![feature(something)]
  17. //!
  18. //! fn main() {
  19. //! println!("Hello, world!");
  20. //! }
  21. //! ```
  22. // @matches foo/index.html '//a[@class="test-arrow"][@href="https://www.example.com/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0A%20%20%20%20println!(%22Hello%2C%20world!%22)%3B%0A%7D&edition=2015"]' "Run"
  23. // @matches foo/index.html '//a[@class="test-arrow"][@href="https://www.example.com/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0Aprintln!(%22Hello%2C%20world!%22)%3B%0A%7D&edition=2015"]' "Run"
  24. // @matches foo/index.html '//a[@class="test-arrow"][@href="https://www.example.com/?code=%23!%5Ballow(unused)%5D%0A%23!%5Bfeature(something)%5D%0A%0Afn%20main()%20%7B%0A%20%20%20%20println!(%22Hello%2C%20world!%22)%3B%0A%7D&version=nightly&edition=2015"]' "Run"