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-05-22 12:17:52 -05:00
|
|
|
// @is "$.index[*][?(@.name=='Unit')].inner.variant.kind" '"plain"'
|
2022-09-05 16:17:50 -05:00
|
|
|
Unit,
|
|
|
|
// @set Named = "$.index[*][?(@.name=='Named')].id"
|
2023-05-22 12:17:52 -05:00
|
|
|
// @is "$.index[*][?(@.name=='Named')].inner.variant.kind.struct" '{"fields": [], "fields_stripped": false}'
|
2022-09-05 16:17:50 -05:00
|
|
|
Named {},
|
|
|
|
// @set Tuple = "$.index[*][?(@.name=='Tuple')].id"
|
2023-05-22 12:17:52 -05:00
|
|
|
// @is "$.index[*][?(@.name=='Tuple')].inner.variant.kind.tuple" []
|
2022-09-05 16:17:50 -05:00
|
|
|
Tuple(),
|
|
|
|
// @set NamedField = "$.index[*][?(@.name=='NamedField')].id"
|
2023-05-22 12:17:52 -05:00
|
|
|
// @set x = "$.index[*][?(@.name=='x' && @.inner.struct_field)].id"
|
|
|
|
// @is "$.index[*][?(@.name=='NamedField')].inner.variant.kind.struct.fields[*]" $x
|
|
|
|
// @is "$.index[*][?(@.name=='NamedField')].inner.variant.kind.struct.fields_stripped" false
|
2022-09-05 16:17:50 -05:00
|
|
|
NamedField { x: i32 },
|
|
|
|
// @set TupleField = "$.index[*][?(@.name=='TupleField')].id"
|
2023-05-22 12:17:52 -05:00
|
|
|
// @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),
|
|
|
|
}
|
|
|
|
|
2023-05-22 12:17:52 -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
|