MCPcopy Create free account
hub / github.com/astral-sh/ruff / self_documenting_fstring

Function self_documenting_fstring

crates/ruff_python_codegen/src/generator.rs:2000–2021  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1998
1999 #[test]
2000 fn self_documenting_fstring() {
2001 assert_round_trip!(r#"f"{ chr(65) = }""#);
2002 assert_round_trip!(r#"f"{ chr(65) = !s}""#);
2003 assert_round_trip!(r#"f"{ chr(65) = !r}""#);
2004 assert_round_trip!(r#"f"{ chr(65) = :#x}""#);
2005 assert_round_trip!(r#"f"{ ( chr(65) ) = }""#);
2006 assert_round_trip!(r#"f"{a=!r:0.05f}""#);
2007 // https://github.com/astral-sh/ruff/issues/18742
2008 assert_eq!(
2009 round_trip(
2010 r#"
2011f"{1=
2012}"
2013"#
2014 ),
2015 r#"
2016f"{1=
2017}"
2018"#
2019 .trim()
2020 );
2021 }
2022
2023 #[test]
2024 fn implicit_string_concatenation() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected