| 1 | pub struct SomeThing { |
| 2 | pub: |
| 3 | m map[string]string |
| 4 | } |
| 5 | |
| 6 | fn (s SomeThing) someval(what string) string { |
| 7 | return s.m[what] |
| 8 | } |
| 9 | |
| 10 | fn (s SomeThing) template() string { |
| 11 | return $tmpl('tmpl/template.in') |
| 12 | } |
| 13 | |
| 14 | fn test_tmpl_with_single_quotes() { |
| 15 | mut sm := map[string]string{} |
| 16 | sm['huh'] = 'monkey' |
| 17 | sm['hah'] = 'parrot' |
| 18 | |
| 19 | s := SomeThing{sm} |
| 20 | result := s.template() |
| 21 | println(result) |
| 22 | assert result.trim_space() == 'someval: monkey |
| 23 | |
| 24 | someotherval: parrot' |
| 25 | } |
| 26 |