]> git.lizzy.rs Git - rust.git/blob - src/test/run-pass/utf8_idents.rs
Merge branch 'master' into cfg_tmp_dir
[rust.git] / src / test / run-pass / utf8_idents.rs
1 // Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10 //
11 // ignore-lexer-test FIXME #15679
12
13 #![feature(non_ascii_idents)]
14
15 use std::num::Float;
16
17 pub fn main() {
18     let ε = 0.00001f64;
19     let Π = 3.14f64;
20     let लंच = Π * Π + 1.54;
21     assert!(((लंच - 1.54) - (Π * Π)).abs() < ε);
22     assert_eq!(საჭმელად_გემრიელი_სადილი(), 0);
23 }
24
25 fn საჭმელად_გემრიელი_სადილი() -> int {
26
27     // Lunch in several languages.
28
29     let ランチ = 10i;
30     let 午餐 = 10i;
31
32     let ארוחת_צהריי = 10i;
33     let غداء = 10u;
34     let լանչ = 10i;
35     let обед = 10i;
36     let абед = 10i;
37     let μεσημεριανό = 10i;
38     let hádegismatur = 10i;
39     let ручек = 10i;
40
41     let ăn_trưa = 10i;
42     let อาหารกลางวัน = 10i;
43
44     // Lunchy arithmetic, mm.
45
46     assert_eq!(hádegismatur * ручек * обед, 1000);
47     assert_eq!(10i, ארוחת_צהריי);
48     assert_eq!(ランチ + 午餐 + μεσημεριανό, 30);
49     assert_eq!(ăn_trưa + อาหารกลางวัน, 20);
50     return (абед + լանչ) >> غداء;
51 }