]> git.lizzy.rs Git - rust.git/blob - src/test/run-pass/utf8_idents.rs
6cd95f1af36b68c62664696bc67686223a8df362
[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
12 #![feature(non_ascii_idents)]
13
14 use std::num;
15
16 pub fn main() {
17     let ε = 0.00001;
18     let Π = 3.14;
19     let लंच = Π * Π + 1.54;
20     assert!(num::abs((लंच - 1.54) - (Π * Π)) < ε);
21     assert_eq!(საჭმელად_გემრიელი_სადილი(), 0);
22 }
23
24 fn საჭმელად_გემრიელი_სადილი() -> int {
25
26     // Lunch in several languages.
27
28     let ランチ = 10;
29     let 午餐 = 10;
30
31     let ארוחת_צהריי = 10;
32     let غداء = 10;
33     let լանչ = 10;
34     let обед = 10;
35     let абед = 10;
36     let μεσημεριανό = 10;
37     let hádegismatur = 10;
38     let ручек = 10;
39
40     let ăn_trưa = 10;
41     let อาหารกลางวัน = 10;
42
43     // Lunchy arithmetic, mm.
44
45     assert_eq!(hádegismatur * ручек * обед, 1000);
46     assert_eq!(10, ארוחת_צהריי);
47     assert_eq!(ランチ + 午餐 + μεσημεριανό, 30);
48     assert_eq!(ăn_trưa + อาหารกลางวัน, 20);
49     return (абед + լանչ) >> غداء;
50 }