diff options
author | Tim-Philipp Müller <tim@centricular.com> | 2016-03-12 14:08:35 +0000 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2016-03-12 14:15:54 +0000 |
commit | 3c8468cd4d90f5072934e849078298e70dd1ddfc (patch) | |
tree | d4447b0b2f6dd5a489c0f0d618b22ae42c7010af /test cases | |
parent | 02e84df0105fb50ab82441b7ec64de149d23b7f9 (diff) | |
download | meson-3c8468cd4d90f5072934e849078298e70dd1ddfc.zip meson-3c8468cd4d90f5072934e849078298e70dd1ddfc.tar.gz meson-3c8468cd4d90f5072934e849078298e70dd1ddfc.tar.bz2 |
Add string underscorify() function
So we can easily construct the defines for include headers and
struct checks and such.
Diffstat (limited to 'test cases')
-rw-r--r-- | test cases/common/42 string formatting/meson.build | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test cases/common/42 string formatting/meson.build b/test cases/common/42 string formatting/meson.build index ea785e8..56cbcb2 100644 --- a/test cases/common/42 string formatting/meson.build +++ b/test cases/common/42 string formatting/meson.build @@ -65,4 +65,17 @@ if long.to_upper().to_lower() != long error('Broken to_lower') endif +if 'struct stat.st_foo'.underscorify() != 'struct_stat_st_foo' + error('Broken underscorify') +endif + +if '#include <foo/bar.h>'.underscorify() != '_include__foo_bar_h_' + error('Broken underscorify') +endif + +# case should not change, space should be replaced, numbers are ok too +if 'Do SomeThing 09'.underscorify() != 'Do_SomeThing_09' + error('Broken underscorify') +endif + assert('3'.to_int() == 3, 'String int conversion does not work.') |