about summary refs log tree commit diff
path: root/compiler/rustc_data_structures/src/thousands/tests.rs
blob: 906605d9a935d6b31cea06774f60c7bbed541b51 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use super::*;

#[test]
fn test_format_with_underscores() {
    assert_eq!("0", format_with_underscores(0));
    assert_eq!("1", format_with_underscores(1));
    assert_eq!("99", format_with_underscores(99));
    assert_eq!("345", format_with_underscores(345));
    assert_eq!("1_000", format_with_underscores(1_000));
    assert_eq!("12_001", format_with_underscores(12_001));
    assert_eq!("999_999", format_with_underscores(999_999));
    assert_eq!("1_000_000", format_with_underscores(1_000_000));
    assert_eq!("12_345_678", format_with_underscores(12_345_678));
}