test_input_number_data.js (1557B)
1 var tests = [ 2 { 3 desc: "British English", 4 langTag: "en-GB", 5 inputWithGrouping: "123,456.78", 6 inputWithoutGrouping: "123456.78", 7 value: 123456.78, 8 }, 9 { 10 desc: "Farsi", 11 langTag: "fa", 12 inputWithGrouping: "۱۲۳٬۴۵۶٫۷۸", 13 inputWithoutGrouping: "۱۲۳۴۵۶٫۷۸", 14 value: 123456.78, 15 }, 16 { 17 desc: "French", 18 langTag: "fr-FR", 19 inputWithGrouping: "123 456,78", 20 inputWithoutGrouping: "123456,78", 21 value: 123456.78, 22 }, 23 { 24 desc: "German", 25 langTag: "de", 26 inputWithGrouping: "123.456,78", 27 inputWithoutGrouping: "123456,78", 28 value: 123456.78, 29 }, 30 // Bug 1509057 disables grouping separators for now, so this test isn't 31 // currently relevant. 32 // Extra german test to check that a locale that uses '.' as its grouping 33 // separator doesn't result in it being invalid (due to step mismatch) due 34 // to the de-localization code mishandling numbers that look like other 35 // numbers formatted for English speakers (i.e. treating this as 123.456 36 // instead of 123456): 37 //{ desc: "German (test 2)", 38 // langTag: "de", inputWithGrouping: "123.456", 39 // inputWithoutGrouping: "123456", value: 123456 40 //}, 41 { 42 desc: "Hebrew", 43 langTag: "he", 44 inputWithGrouping: "123,456.78", 45 inputWithoutGrouping: "123456.78", 46 value: 123456.78, 47 }, 48 ]; 49 50 var invalidTests = [ 51 // Right now this will pass in a 'de' build, but not in the 'en' build that 52 // are used for testing. See bug 1216831. 53 // { desc: "Invalid German", langTag: "de", input: "12.34" } 54 ];