diff options
| author | Alona Enraght-Moony <code@alona.page> | 2024-12-01 21:37:18 +0000 |
|---|---|---|
| committer | Alona Enraght-Moony <code@alona.page> | 2024-12-01 21:37:18 +0000 |
| commit | 51ea7c12e70244dc89893888f3bfd6cead59d4c5 (patch) | |
| tree | 13828bc3dabfc857887c81bc008c1343f7b2a48c | |
| parent | 15b663e684d0acf1b4299b7ad6b4f4ab106395bd (diff) | |
| download | rust-51ea7c12e70244dc89893888f3bfd6cead59d4c5.tar.gz rust-51ea7c12e70244dc89893888f3bfd6cead59d4c5.zip | |
rustdoc-json: Add tests for `static`s
| -rw-r--r-- | tests/rustdoc-json/statics/statics.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/rustdoc-json/statics/statics.rs b/tests/rustdoc-json/statics/statics.rs new file mode 100644 index 00000000000..e3ed9369925 --- /dev/null +++ b/tests/rustdoc-json/statics/statics.rs @@ -0,0 +1,10 @@ +//@ is '$.index[*][?(@.name=="A")].inner.static.type.primitive' '"i32"' +//@ is '$.index[*][?(@.name=="A")].inner.static.is_mutable' false +//@ is '$.index[*][?(@.name=="A")].inner.static.expr' '"5"' +pub static A: i32 = 5; + +//@ is '$.index[*][?(@.name=="B")].inner.static.type.primitive' '"u32"' +//@ is '$.index[*][?(@.name=="B")].inner.static.is_mutable' true +// Expr value isn't gaurenteed, it'd be fine to change it. +//@ is '$.index[*][?(@.name=="B")].inner.static.expr' '"_"' +pub static mut B: u32 = 2 + 3; |
