js/src/tests/test262/ch12/12.13/S12.13_A3_T3.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/tests/test262/ch12/12.13/S12.13_A3_T3.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,92 @@
     1.4 +// Copyright 2009 the Sputnik authors.  All rights reserved.
     1.5 +// This code is governed by the BSD license found in the LICENSE file.
     1.6 +
     1.7 +/**
     1.8 + * 1. Evaluate Expression
     1.9 + *
    1.10 + * @path ch12/12.13/S12.13_A3_T3.js
    1.11 + * @description Evaluating number expression
    1.12 + */
    1.13 +
    1.14 +// CHECK#1
    1.15 +try{
    1.16 +  throw 10+3;
    1.17 +}
    1.18 +catch(e){
    1.19 +  if (e!==13) $ERROR('#1: Exception ===13(operaton +). Actual:  Exception ==='+ e);
    1.20 +}
    1.21 +
    1.22 +// CHECK#2
    1.23 +var b=10;
    1.24 +var a=3;
    1.25 +try{
    1.26 +  throw a+b;
    1.27 +}
    1.28 +catch(e){
    1.29 +  if (e!==13) $ERROR('#2: Exception ===13(operaton +). Actual:  Exception ==='+ e);
    1.30 +}
    1.31 +
    1.32 +// CHECK#3
    1.33 +try{
    1.34 +  throw 3.15-1.02;
    1.35 +}
    1.36 +catch(e){
    1.37 +  if (e!==2.13) $ERROR('#3: Exception ===2.13(operaton -). Actual:  Exception ==='+ e);
    1.38 +}
    1.39 +
    1.40 +// CHECK#4
    1.41 +try{
    1.42 +  throw 2*2;
    1.43 +}
    1.44 +catch(e){
    1.45 +  if (e!==4) $ERROR('#4: Exception ===4(operaton *). Actual:  Exception ==='+ e);
    1.46 +}
    1.47 +
    1.48 +// CHECK#5
    1.49 +try{
    1.50 +  throw 1+Infinity;
    1.51 +}
    1.52 +catch(e){
    1.53 +  if (e!==+Infinity) $ERROR('#5: Exception ===+Infinity(operaton +). Actual:  Exception ==='+ e);
    1.54 +}
    1.55 +
    1.56 +// CHECK#6
    1.57 +try{
    1.58 +  throw 1-Infinity;
    1.59 +}
    1.60 +catch(e){
    1.61 +  if (e!==-Infinity) $ERROR('#6: Exception ===-Infinity(operaton -). Actual:  Exception ==='+ e);
    1.62 +}
    1.63 +
    1.64 +// CHECK#7
    1.65 +try{
    1.66 +  throw 10/5;
    1.67 +}
    1.68 +catch(e){
    1.69 +  if (e!==2) $ERROR('#7: Exception ===2(operaton /). Actual:  Exception ==='+ e);
    1.70 +}
    1.71 +
    1.72 +// CHECK#8
    1.73 +try{
    1.74 +  throw 8>>2;
    1.75 +}
    1.76 +catch(e){
    1.77 +  if (e!==2) $ERROR('#8: Exception ===2(operaton >>). Actual:  Exception ==='+ e);
    1.78 +}
    1.79 +
    1.80 +// CHECK#9
    1.81 +try{
    1.82 +  throw 2<<2;
    1.83 +}
    1.84 +catch(e){
    1.85 +  if (e!==8) $ERROR('#9: Exception ===8(operaton <<). Actual:  Exception ==='+ e);
    1.86 +}
    1.87 +
    1.88 +// CHECK#10
    1.89 +try{
    1.90 +  throw 123%100;
    1.91 +}
    1.92 +catch(e){
    1.93 +  if (e!==23) $ERROR('#10: Exception ===23(operaton %). Actual:  Exception ==='+ e);
    1.94 +}
    1.95 +

mercurial