blob: 78af4158b469cb10b4cfcf4ea277e3971ecda82a [file] [log] [blame]
Arabic number input should accept ASCII digits and Arabic digits, and reject others.
PASS 123.4 is 123.4
PASS displayValueForKeyInput(input_ar, "123.4", "", 123.4) is "123.4"
PASS 1.23E+19 is 12300000000000000000
PASS displayValueForKeyInput(input_ar, "1.23E+19", "", 12300000000000000000) is "1.23E+19"
PASS 1.23e-1 is 0.123
PASS displayValueForKeyInput(input_ar, "1.23e-1", "", 0.123) is "1.23e-1"
PASS 190 is 190
PASS displayValueForKeyInput(input_ar, "١٩٠", "", 190) is "١٩٠"
PASS is undefined.
PASS displayValueForKeyInput(input_ar, "acdef", "", undefined) is "e"
French number input should accept ASCII digits, comma, and full stop.
PASS 1234.56 is 1234.56
PASS displayValueForKeyInput(input_fr, "1234.56", "", 1234.56) is "1234.56"
PASS 1234.56 is 1234.56
PASS displayValueForKeyInput(input_fr, "1234,56", "", 1234.56) is "1234,56"
English number input should accept ASCII digits and full stop, and no comma.
PASS 1234.56 is 1234.56
PASS displayValueForKeyInput(input_en, "1234.56", "", 1234.56) is "1234.56"
PASS -123456 is -123456
PASS displayValueForKeyInput(input_en, "-1234,56", "", -123456) is "-123456"
PASS 1234.56 is 1234.56
PASS displayValueForKeyInput(input_en, " 1234.56 ", "", 1234.56) is "1234.56"
PASS window.getSelection().toString() is "-1-1"
PASS -1e-1 is -0.1
PASS displayValueForKeyInput(input_en, "e", "-1|-1", -0.1) is "-1e-1"
Test all locales.
PASS 123456789E+10 is 1234567890000000000
PASS displayValueForKeyInput(input_en, "123,456,789E+10", "", 1234567890000000000) is "123456789E+10"
PASS window.getSelection().toString() is "1e2"
PASS 1.e2 is 100
PASS displayValueForKeyInput(input_fr, ".", "1|e2", 100) is "1.e2"
PASS window.getSelection().toString() is "1e2"
PASS 1.e2 is 100
PASS displayValueForKeyInput(input_en, ".", "1|e2", 100) is "1.e2"
PASS window.getSelection().toString() is "1e2"
PASS 1e2 is 100
PASS displayValueForKeyInput(input_fr, ",", "1e2|", 100) is "1e2"
PASS window.getSelection().toString() is "1e2"
PASS 1e2 is 100
PASS displayValueForKeyInput(input_en, ".", "1e2|", 100) is "1e2"
PASS window.getSelection().toString() is "-12"
PASS -12 is -12
PASS displayValueForKeyInput(input_fr, ",", "|-12", -12) is "-12"
PASS window.getSelection().toString() is "-12"
PASS -12 is -12
PASS displayValueForKeyInput(input_en, ".", "|-12", -12) is "-12"
PASS window.getSelection().toString() is "1e-12"
PASS .1e-12 is 1e-13
PASS displayValueForKeyInput(input_fr, ".", "|1e-12", 1e-13) is ".1e-12"
PASS window.getSelection().toString() is "1e-12"
PASS .1e-12 is 1e-13
PASS displayValueForKeyInput(input_en, ".", "|1e-12", 1e-13) is ".1e-12"
PASS window.getSelection().toString() is "3412"
PASS 34e12 is 34000000000000
PASS displayValueForKeyInput(input_fr, "e", "34|12", 34000000000000) is "34e12"
PASS window.getSelection().toString() is "3412"
PASS 34e12 is 34000000000000
PASS displayValueForKeyInput(input_en, "e", "34|12", 34000000000000) is "34e12"
PASS window.getSelection().toString() is "123e4"
PASS 123e4 is 1230000
PASS displayValueForKeyInput(input_fr, "e", "12|3e4", 1230000) is "123e4"
PASS window.getSelection().toString() is "123e4"
PASS 123e4 is 1230000
PASS displayValueForKeyInput(input_en, "e", "12|3e4", 1230000) is "123e4"
PASS window.getSelection().toString() is "123,4"
PASS 123.4 is 123.4
PASS displayValueForKeyInput(input_fr, "e", "123|,4", 123.4) is "123,4"
PASS window.getSelection().toString() is "123.4"
PASS 123.4 is 123.4
PASS displayValueForKeyInput(input_en, "e", "123|.4", 123.4) is "123.4"
PASS window.getSelection().toString() is "12.34"
PASS 12.3e4 is 123000
PASS displayValueForKeyInput(input_fr, "e", "12.3|4", 123000) is "12.3e4"
PASS window.getSelection().toString() is "12.34"
PASS 12.3e4 is 123000
PASS displayValueForKeyInput(input_en, "e", "12.3|4", 123000) is "12.3e4"
PASS window.getSelection().toString() is "١٢٣٤"
PASS is undefined.
PASS displayValueForKeyInput(input_ar, "+", "١٢|٣٤", undefined) is "١٢+٣٤"
PASS window.getSelection().toString() is "1234"
PASS is undefined.
PASS displayValueForKeyInput(input_fr, "+", "12|34", undefined) is "12+34"
PASS window.getSelection().toString() is "1234"
PASS is undefined.
PASS displayValueForKeyInput(input_en, "+", "12|34", undefined) is "12+34"
PASS window.getSelection().toString() is "-34e-12"
PASS -34e-12 is -3.4e-11
PASS displayValueForKeyInput(input_fr, "+", "-3|4e-12", -3.4e-11) is "-34e-12"
PASS window.getSelection().toString() is "-34e-12"
PASS -34e-12 is -3.4e-11
PASS displayValueForKeyInput(input_en, "+", "-3|4e-12", -3.4e-11) is "-34e-12"
PASS window.getSelection().toString() is "١٢٣٤"
PASS 1234 is 1234
PASS displayValueForKeyInput(input_ar, "+", "|١٢٣٤", 1234) is "+١٢٣٤"
PASS window.getSelection().toString() is "1234"
PASS 1234 is 1234
PASS displayValueForKeyInput(input_fr, "+", "|1234", 1234) is "+1234"
PASS window.getSelection().toString() is "1234"
PASS 1234 is 1234
PASS displayValueForKeyInput(input_en, "+", "|1234", 1234) is "+1234"
PASS window.getSelection().toString() is "123e4"
PASS 123e-4 is 0.0123
PASS displayValueForKeyInput(input_fr, "-", "123e|4", 0.0123) is "123e-4"
PASS window.getSelection().toString() is "123e4"
PASS 123e-4 is 0.0123
PASS displayValueForKeyInput(input_en, "-", "123e|4", 0.0123) is "123e-4"
PASS window.getSelection().toString() is "123e4"
PASS 123e4 is 1230000
PASS displayValueForKeyInput(input_fr, "-", "1|23e4", 1230000) is "123e4"
PASS window.getSelection().toString() is "123e4"
PASS 123e4 is 1230000
PASS displayValueForKeyInput(input_en, "-", "1|23e4", 1230000) is "123e4"
PASS window.getSelection().toString() is "123e4"
PASS 123e4 is 1230000
PASS displayValueForKeyInput(input_fr, "-", "123e4|", 1230000) is "123e4"
PASS window.getSelection().toString() is "123e4"
PASS 123e4 is 1230000
PASS displayValueForKeyInput(input_en, "-", "123e4|", 1230000) is "123e4"
PASS window.getSelection().toString() is "-1"
PASS -1 is -1
PASS displayValueForKeyInput(input_fr, "9", "|-1", -1) is "-1"
PASS window.getSelection().toString() is "-1"
PASS -1 is -1
PASS displayValueForKeyInput(input_en, "9", "|-1", -1) is "-1"
PASS window.getSelection().toString() is "-1"
PASS -91 is -91
PASS displayValueForKeyInput(input_fr, "9", "-|1", -91) is "-91"
PASS window.getSelection().toString() is "-1"
PASS -91 is -91
PASS displayValueForKeyInput(input_en, "9", "-|1", -91) is "-91"
PASS window.getSelection().toString() is "1e+2"
PASS 1e+2 is 100
PASS displayValueForKeyInput(input_fr, "9", "1e|+2", 100) is "1e+2"
PASS window.getSelection().toString() is "1e+2"
PASS 1e+2 is 100
PASS displayValueForKeyInput(input_en, "9", "1e|+2", 100) is "1e+2"
PASS window.getSelection().toString() is "1e+2"
PASS 1e+12 is 1000000000000
PASS displayValueForKeyInput(input_fr, "1", "1e+|2", 1000000000000) is "1e+12"
PASS window.getSelection().toString() is "1e+2"
PASS 1e+12 is 1000000000000
PASS displayValueForKeyInput(input_en, "1", "1e+|2", 1000000000000) is "1e+12"
PASS is undefined.
PASS displayValueForKeyInput(input_fr, " abcdef ", "", undefined) is "e"
PASS is undefined.
PASS displayValueForKeyInput(input_en, " abcdef ", "", undefined) is "e"
PASS is undefined.
PASS displayValueForKeyInput(input_ar, "+١-٢", "", undefined) is "+١-٢"
PASS is undefined.
PASS displayValueForKeyInput(input_fr, "+1-2", "", undefined) is "+1-2"
PASS is undefined.
PASS displayValueForKeyInput(input_en, "+1-2", "", undefined) is "+1-2"
PASS is undefined.
PASS displayValueForKeyInput(input_ar, "+١-٢+٢-٣", "", undefined) is "+١-٢+٢-٣"
PASS is undefined.
PASS displayValueForKeyInput(input_fr, "+1-2+2-3", "", undefined) is "+1-223"
PASS is undefined.
PASS displayValueForKeyInput(input_en, "+1-2+2-3", "", undefined) is "+1-223"
PASS is undefined.
PASS displayValueForKeyInput(input_ar, "٠-١٢٣-١٢٣+١٢٣", "", undefined) is "٠-١٢٣-١٢٣+١٢٣"
PASS is undefined.
PASS displayValueForKeyInput(input_fr, "0-123-123+123", "", undefined) is "0-123-123123"
PASS is undefined.
PASS displayValueForKeyInput(input_en, "0-123-123+123", "", undefined) is "0-123-123123"
PASS is undefined.
PASS displayValueForKeyInput(input_fr, "10e123123e1231233e", "", undefined) is "10e1231231231233"
PASS is undefined.
PASS displayValueForKeyInput(input_en, "10e123123e1231233e", "", undefined) is "10e1231231231233"
PASS 1e2 is 100
PASS displayValueForKeyInput(input_fr, "1e2eee", "", 100) is "1e2"
PASS 1e2 is 100
PASS displayValueForKeyInput(input_en, "1e2eee", "", 100) is "1e2"
PASS 1e11 is 100000000000
PASS displayValueForKeyInput(input_fr, "1e1e1e", "", 100000000000) is "1e11"
PASS 1e11 is 100000000000
PASS displayValueForKeyInput(input_en, "1e1e1e", "", 100000000000) is "1e11"
PASS successfullyParsed is true
TEST COMPLETE