2022-09-05 16:17:50 -05:00
|
|
|
// ignore-tidy-linelength
|
|
|
|
|
|
|
|
#![feature(no_core)]
|
|
|
|
#![no_core]
|
|
|
|
|
|
|
|
pub enum Foo {
|
|
|
|
// @set Unit = "$.index[*][?(@.name=='Unit')].id"
|
2023-01-01 12:53:50 -06:00
|
|
|
// @is "$.index[*][?(@.name=='Unit')].inner.kind" '"plain"'
|
2022-09-05 16:17:50 -05:00
|
|
|
Unit,
|
|
|
|
// @set Named = "$.index[*][?(@.name=='Named')].id"
|
2023-01-01 12:53:50 -06:00
|
|
|
// @is "$.index[*][?(@.name=='Named')].inner.kind.struct" '{"fields": [], "fields_stripped": false}'
|
2022-09-05 16:17:50 -05:00
|
|
|
Named {},
|
|
|
|
// @set Tuple = "$.index[*][?(@.name=='Tuple')].id"
|
2023-01-01 12:53:50 -06:00
|
|
|
// @is "$.index[*][?(@.name=='Tuple')].inner.kind.tuple" []
|
2022-09-05 16:17:50 -05:00
|
|
|
Tuple(),
|
|
|
|
// @set NamedField = "$.index[*][?(@.name=='NamedField')].id"
|
|
|
|
// @set x = "$.index[*][?(@.name=='x' && @.kind=='struct_field')].id"
|
2023-01-01 12:53:50 -06:00
|
|
|
// @is "$.index[*][?(@.name=='NamedField')].inner.kind.struct.fields[*]" $x
|
|
|
|
// @is "$.index[*][?(@.name=='NamedField')].inner.kind.struct.fields_stripped" false
|
2022-09-05 16:17:50 -05:00
|
|
|
NamedField { x: i32 },
|
|
|
|
// @set TupleField = "$.index[*][?(@.name=='TupleField')].id"
|
|
|
|
// @set tup_field = "$.index[*][?(@.name=='0' && @.kind=='struct_field')].id"
|
2023-01-01 12:53:50 -06:00
|
|
|
// @is "$.index[*][?(@.name=='TupleField')].inner.kind.tuple[*]" $tup_field
|
2022-09-05 16:17:50 -05:00
|
|
|
TupleField(i32),
|
|
|
|
}
|
|
|
|
|
|
|
|
// @is "$.index[*][?(@.name=='Foo')].inner.variants[0]" $Unit
|
|
|
|
// @is "$.index[*][?(@.name=='Foo')].inner.variants[1]" $Named
|
|
|
|
// @is "$.index[*][?(@.name=='Foo')].inner.variants[2]" $Tuple
|
|
|
|
// @is "$.index[*][?(@.name=='Foo')].inner.variants[3]" $NamedField
|
|
|
|
// @is "$.index[*][?(@.name=='Foo')].inner.variants[4]" $TupleField
|
|
|
|
// @count "$.index[*][?(@.name=='Foo')].inner.variants[*]" 5
|