summaryrefslogtreecommitdiff
path: root/external/contributions/Google/sputnik_conformance_modified/15_Native/15.1_The_Global_Object/15.1.3_URI_Handling_Function_Properties/15.1.3.1_decodeURI/S15.1.3.1_A1.1_T1.js
diff options
context:
space:
mode:
Diffstat (limited to 'external/contributions/Google/sputnik_conformance_modified/15_Native/15.1_The_Global_Object/15.1.3_URI_Handling_Function_Properties/15.1.3.1_decodeURI/S15.1.3.1_A1.1_T1.js')
-rw-r--r--external/contributions/Google/sputnik_conformance_modified/15_Native/15.1_The_Global_Object/15.1.3_URI_Handling_Function_Properties/15.1.3.1_decodeURI/S15.1.3.1_A1.1_T1.js58
1 files changed, 58 insertions, 0 deletions
diff --git a/external/contributions/Google/sputnik_conformance_modified/15_Native/15.1_The_Global_Object/15.1.3_URI_Handling_Function_Properties/15.1.3.1_decodeURI/S15.1.3.1_A1.1_T1.js b/external/contributions/Google/sputnik_conformance_modified/15_Native/15.1_The_Global_Object/15.1.3_URI_Handling_Function_Properties/15.1.3.1_decodeURI/S15.1.3.1_A1.1_T1.js
new file mode 100644
index 000000000..357686a18
--- /dev/null
+++ b/external/contributions/Google/sputnik_conformance_modified/15_Native/15.1_The_Global_Object/15.1.3_URI_Handling_Function_Properties/15.1.3.1_decodeURI/S15.1.3.1_A1.1_T1.js
@@ -0,0 +1,58 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * @name: S15.1.3.1_A1.1_T1;
+ * @section: 15.1.3.1;
+ * @assertion: If string.charAt(k) equal "%" and k + 2 >= string.length, throw URIError;
+ * @description: Complex tests;
+*/
+
+var result = true;
+
+//CHECK#1
+try {
+ decodeURI("%");
+ result = false;
+} catch(e) {
+ if ((e instanceof URIError) !== true) {
+ result = false;
+ }
+}
+
+//CHECK#2
+try {
+ decodeURI("%A");
+ result = false;
+} catch(e) {
+ if ((e instanceof URIError) !== true) {
+ result = false;
+ }
+}
+
+//CHECK#3
+try {
+ decodeURI("%1");
+ result = false;
+} catch(e) {
+ if ((e instanceof URIError) !== true) {
+ result = false;
+ }
+}
+
+//CHECK#4
+try {
+ decodeURI("% ");
+ result = false;
+} catch(e) {
+ if ((e instanceof URIError) !== true) {
+ result = false;
+ }
+}
+
+if (result !== true) {
+ $ERROR('#1: If string.charAt(k) equal "%" and k + 2 >= string.length, throw URIError');
+}
+
+
+