From: Jeeeyul Date: Thu, 19 Dec 2013 06:36:51 +0000 (+0900) Subject: Test case was added for Korean Meridiem Parser support. X-Git-Tag: 2.5.0^2~3^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d8ae32fbe383b5eadadae7e81ec3d6a28dfe06f8;p=thirdparty%2Fmoment.git Test case was added for Korean Meridiem Parser support. --- diff --git a/test/lang/ko.js b/test/lang/ko.js index 947183fd7..40e50a76b 100644 --- a/test/lang/ko.js +++ b/test/lang/ko.js @@ -36,6 +36,46 @@ exports["lang:kr"] = { } test.done(); }, + + + "parse meridiem" : function(test){ + var elements = [{ + expression : "1981년 9월 8일 오후 2시 30분", + inputFormat : "YYYY[년] M[월] D[일] A h[시] m[분]", + outputFormat : "A", + expected : "오후" + },{ + expression : "1981년 9월 8일 오전 2시 30분", + inputFormat : "YYYY[년] M[월] D[일] A h[시] m[분]", + outputFormat : "A h시", + expected : "오전 2시" + },{ + expression : "14시 30분", + inputFormat : "H[시] m[분]", + outputFormat : "A", + expected : "오후" + },{ + expression : "오후 4시", + inputFormat : "A h[시]", + outputFormat : "H", + expected : "16" + }]; + + test.expect(elements.length); + + elements.forEach(function(it){ + var actual = moment(it.expression, it.inputFormat).format(it.outputFormat); + + test.equal( + actual, + it.expected, + "'" + it.outputFormat + "' of '" + it.expression + "' must be '" + it.expected + "' but was '" + actual + "'." + ); + }); + + test.done(); + }, + "format" : function (test) { test.expect(22);