Advertisement
kstoyanov

05. Check for Symmetry

Oct 26th, 2020
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. describe("isSymmetric(arr)", function () {
  2.     it("should return true for [1,2,3,3,2,1]", function () {
  3.         expect(isSymmetric([1,2,3,3,2,1])).to.be.equal(true);
  4.     });
  5.     it("should return false for [1,2,3,4,2,1]", function () {
  6.         expect(isSymmetric([1,2,3,4,2,1])).to.be.equal(false);
  7.     });
  8.     it("should return true for [-1,2,-1]", function () {
  9.         expect(isSymmetric([-1,2,-1])).to.be.equal(true);
  10.     });
  11.     it("should return false for [-1,2,1]", function () {
  12.         expect(isSymmetric([-1,2,1])).to.be.equal(false);
  13.     });
  14.     it("should return false for [1,2]", function () {
  15.         expect(isSymmetric([1,2])).to.be.equal(false);
  16.     });
  17.     it("should return true for [1]", function () {
  18.         expect(isSymmetric([1])).to.be.equal(true);
  19.     });
  20.     it("should return true for [5,'hi',{a:5},new Date(),{a:5},'hi',5]", function () {
  21.         expect(isSymmetric([5,'hi',{a:5},new Date(),{a:5},'hi',5])).to.be.equal(true);
  22.     });
  23.     it("should return false for [5,'hi',{a:5},new Date(),{X:5},'hi',5]", function () {
  24.         expect(isSymmetric([5,'hi',{a:5},new Date(),{X:5},'hi',5])).to.be.equal(false);
  25.     });
  26.     it("should return false for 1,2,2,1", function () {
  27.         expect (isSymmetric(1,2,2,1)).to.be.equal(false);
  28.     });
  29. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement