| 1 | import v.reflection as r |
| 2 | |
| 3 | struct MyParams { |
| 4 | p_fpga_ver string @[long: fp_ver; name: 'FPGA Version'; xdoc: 'String to use as simulated FPGA version in Version responses. Must be in the form "a.bb.cccc"'] |
| 5 | p_cm_ver string @[long: cm_ver; name: 'CM Version'; xdoc: 'String to use as simulated CM version in Version responses. Must be in the form "a.bb.cccc"'] |
| 6 | } |
| 7 | |
| 8 | fn test_main() { |
| 9 | a := MyParams{} |
| 10 | t := r.type_of(a) |
| 11 | if t.sym.info is r.Struct { |
| 12 | assert t.sym.info.fields[0].attrs[2] == VAttribute{ |
| 13 | name: 'xdoc' |
| 14 | has_arg: true |
| 15 | arg: 'String to use as simulated FPGA version in Version responses. Must be in the form "a.bb.cccc"' |
| 16 | kind: .string |
| 17 | } |
| 18 | } else { |
| 19 | assert false |
| 20 | } |
| 21 | } |
| 22 | |