2022-09-05 16:17:50 -05:00
|
|
|
// ignore-tidy-linelength
|
|
|
|
|
|
|
|
pub enum Foo {
|
2024-07-19 09:50:47 -05:00
|
|
|
//@ set Unit = "$.index[*][?(@.name=='Unit')].id"
|
|
|
|
//@ is "$.index[*][?(@.name=='Unit')].inner.variant.kind" '"plain"'
|
2022-09-05 16:17:50 -05:00
|
|
|
Unit,
|
2024-07-19 09:50:47 -05:00
|
|
|
//@ set Named = "$.index[*][?(@.name=='Named')].id"
|
2024-08-04 18:44:35 -05:00
|
|
|
//@ is "$.index[*][?(@.name=='Named')].inner.variant.kind.struct" '{"fields": [], "has_stripped_fields": false}'
|
2022-09-05 16:17:50 -05:00
|
|
|
Named {},
|
2024-07-19 09:50:47 -05:00
|
|
|
//@ set Tuple = "$.index[*][?(@.name=='Tuple')].id"
|
|
|
|
//@ is "$.index[*][?(@.name=='Tuple')].inner.variant.kind.tuple" []
|
2022-09-05 16:17:50 -05:00
|
|
|
Tuple(),
|
2024-07-19 09:50:47 -05:00
|
|
|
//@ set NamedField = "$.index[*][?(@.name=='NamedField')].id"
|
|
|
|
//@ set x = "$.index[*][?(@.name=='x' && @.inner.struct_field)].id"
|
|
|
|
//@ is "$.index[*][?(@.name=='NamedField')].inner.variant.kind.struct.fields[*]" $x
|
2024-08-04 18:44:35 -05:00
|
|
|
//@ is "$.index[*][?(@.name=='NamedField')].inner.variant.kind.struct.has_stripped_fields" false
|
2022-09-05 16:17:50 -05:00
|
|
|
NamedField { x: i32 },
|
2024-07-19 09:50:47 -05:00
|
|
|
//@ set TupleField = "$.index[*][?(@.name=='TupleField')].id"
|
|
|
|
//@ set tup_field = "$.index[*][?(@.name=='0' && @.inner.struct_field)].id"
|
|
|
|
//@ is "$.index[*][?(@.name=='TupleField')].inner.variant.kind.tuple[*]" $tup_field
|
2022-09-05 16:17:50 -05:00
|
|
|
TupleField(i32),
|
|
|
|
}
|
|
|
|
|
2024-07-19 09:50:47 -05:00
|
|
|
//@ is "$.index[*][?(@.name=='Foo')].inner.enum.variants[0]" $Unit
|
|
|
|
//@ is "$.index[*][?(@.name=='Foo')].inner.enum.variants[1]" $Named
|
|
|
|
//@ is "$.index[*][?(@.name=='Foo')].inner.enum.variants[2]" $Tuple
|
|
|
|
//@ is "$.index[*][?(@.name=='Foo')].inner.enum.variants[3]" $NamedField
|
|
|
|
//@ is "$.index[*][?(@.name=='Foo')].inner.enum.variants[4]" $TupleField
|
|
|
|
//@ count "$.index[*][?(@.name=='Foo')].inner.enum.variants[*]" 5
|