Advertisement
Guest User

Untitled

a guest
Dec 9th, 2017
382
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const expect = require("chai").expect;
  2. const part1 = require("./../solutions/09-stream-processing/solution").part1;
  3. const part2 = require("./../solutions/09-stream-processing/solution").part2;
  4. const FINAL_INPUT = require("./../solutions/09-stream-processing/finalInput").finalInput;
  5.  
  6. describe("09-stream-processing", function() {
  7.     describe("part 1", function() {
  8.         it("on input '{{<ab>},{<ab>},{<ab>},{<ab>}}' should return 9", function(done) {
  9.             const input = "{{<ab>},{<ab>},{<ab>},{<ab>}}";
  10.             const expected = 9;
  11.             expect(part1(input)).to.equal(expected);
  12.             done();
  13.         });
  14.         it("on input '{{<ab>},{<ab>},{<ab>},{<ab>}}' should return 9", function(done) {
  15.             const input = "{{<ab>},{<ab>},{<ab>},{<ab>}}";
  16.             const expected = 9;
  17.             expect(part1(input)).to.equal(expected);
  18.             done();
  19.         });
  20.         it("on input '{{{},{},{{}}}}' should return 16", function(done) {
  21.             const input = "{{{},{},{{}}}}";
  22.             const expected = 16;
  23.             expect(part1(input)).to.equal(expected);
  24.             done();
  25.         });
  26.         it("on the final input, should return 11089", function(done) {
  27.             const input = FINAL_INPUT;
  28.             const expected = 11089;
  29.             expect(part1(input)).to.equal(expected);
  30.             done();
  31.         });
  32.     });
  33.     describe("part 2", function() {
  34.         it("on input '<>' should return 0", function(done) {
  35.             const input = "<>";
  36.             const expected = 0;
  37.             expect(part2(input)).to.equal(expected);
  38.             done();
  39.         });
  40.         it(`on input '<{o"i!a,<{i<a>' should return 10`, function(done) {
  41.             const input = `<{o"i!a,<{i<a>`;
  42.            const expected = 10;
  43.            expect(part2(input)).to.equal(expected);
  44.            done();
  45.        });
  46.        it("on the final input, should return 5288", function(done) {
  47.            const input = FINAL_INPUT;
  48.            const expected = 5288;
  49.            expect(part2(input)).to.equal(expected);
  50.            done();
  51.        });
  52.    });
  53. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement