summaryrefslogtreecommitdiffstats
path: root/test cases/common/234 get_file_contents/meson.build
blob: a8c68d63f334a5616ef9c9ffa65b843b3aeb329d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
project(
  'meson-fs-read-file',
  [],
  version: files('VERSION')
)
fs = import('fs')

assert(fs.read('VERSION').strip() == meson.project_version(), 'file misread')

expected = (
  '∮ E⋅da = Q,  n → ∞, ∑ f(i) = ∏ g(i), ∀x∈ℝ: ⌈x⌉ = −⌊−x⌋, α ∧ ¬β = ¬(¬α ∨ β)'
)
assert(
  fs.read('utf-16-text', encoding: 'utf-16').strip() == expected,
  'file was not decoded correctly'
)

# Make sure we handle `files()` objects properly, too
version_file = files('VERSION')

subdir('other')