text: /**
   * StoryScript
   * Copyright (c) 2021, GoldFire Studios, Inc.
   * https://goldfirestudios.com
   */
  
  const fs = require('fs');
  const path = require('path');
  const test = require('ava');
  const Lexer = require('../src/lexer');
  const types = require('../src/types');
  const script = fs.readFileSync(path.join(__dirname, './sample.txt'), 'utf8');
  
  test('all tokens generated', (t) => {
    const lexer = new Lexer(script);
    const tokens = lexer.run();
  
    t.deepEqual(tokens, [
      {type: types.SCENE, line: 1, value: 'EXT. SAMPLE SCENE - DAY 1 - AFTERNOON - CALM'},
      {type: types.STRING, line: 2, value: 'Jack then yells to the two Men he\'s with to take the Tourniquet Man to safety -- and Jack RUNS -- OVER THE WING, 18 BEHIND THE MONSTROUS REVVING ENGINE -- 18 over to the Australian Pregnant Woman (CLAIRE) -- he helps her up -- helps her walk -- but she stumbles again, strains:'},
      {type: types.EMPTYLINE, line: 3},
      {type: types.STRING, line: 4, value: 'CLAIRE'},
      {type: types.PARENTHETICAL, line: 5, value: 'scared'},
      {type: types.STRING, line: 6, value: 'I\'m having contractions--'},
      {type: types.EMPTYLINE, line: 7},
      {type: types.STRING, line: 8, value: 'JACK'},
      {type: types.STRING, line: 9, value: 'That\'s not ideal...'},
      {type: types.PARENTHETICAL, line: 10, value: 'beat'},
      {type: types.STRING, line: 11, value: 'How far apart are they?'},
      {type: types.EMPTYLINE, line: 12},
      {type: types.CONDITIONAL, line: 13, value: 'TestFact'},
      {type: types.EMPTYLINE, line: 14},
      {type: types.STRING, line: 15, value: 'CLAIRE'},
      {type: types.STRING, line: 16, value: 'I don\'t know, a few of \'em just happened.'},
      {type: types.EMPTYLINE, line: 17},
      {type: types.CONDITIONAL_END, line: 18},
      {type: types.EMPTYLINE, line: 19},
      {type: types.STRING, line: 20, value: 'JACK'},
      {type: types.STRING, line: 21, value: 'How many months pregnant are you?'},
      {type: types.EMPTYLINE, line: 22},
      {type: types.STRING, line: 23, value: 'JACK (IDLE)'},
      {type: types.STRING, line: 24, value: 'We could end up out here a while.'},
      {type: types.EMPTYLINE, line: 25},
      {type: types.CHOICE, line: 26, value: 'Choice #1'},
      {type: types.CHOICE_FACT, line: 27, value: 'SampleScene_Choice01_01'},
      {type: types.CHOICE, line: 28, value: 'Choice #2'},
      {type: types.CHOICE_FACT, line: 29, value: 'SampleScene_Choice01_02'},
      {type: types.CHOICE, line: 30, value: 'Choice #3'},
      {type: types.CHOICE_FACT, line: 31, value: 'SampleScene_Choice01_03'},
      {type: types.CHOICE, line: 32, value: '[silence]'},
      {type: types.CHOICE_FACT, line: 33, value: 'SampleScene_Choice01_Silence'},
      {type: types.EMPTYLINE, line: 34},
      {type: types.CONDITIONAL, line: 35, value: 'SampleScene_Choice01_01'},
      {type: types.EMPTYLINE, line: 36},
      {type: types.STRING, line: 37, value: 'CLAIRE'},
      {type: types.STRING, line: 38, value: 'Almost eight months.'},
      {type: types.EMPTYLINE, line: 39},
      {type: types.STRING, line: 40, value: 'JACK'},
      {type: types.STRING, line: 41, value: 'Listen to me. Listen to me, you\'re gonna be okay... do you understand? But you need to lie absolutely (still)--'},
      {type: types.EMPTYLINE, line: 42},
      {type: types.CONDITIONAL_END, line: 43},
      {type: types.EMPTYLINE, line: 44},
      {type: types.CONDITIONAL, line: 45, value: 'SampleScene_Choice01_02'},
      {type: types.EMPTYLINE, line: 46},
      {type: types.STRING, line: 47, value: 'CLAIRE'},
      {type: types.STRING, line: 48, value: 'That seems sort of personal!'},
      {type: types.EMPTYLINE, line: 49},
      {type: types.STRING, line: 50, value: 'JACK'},
      {type: types.STRING, line: 51, value: 'Listen to me! Now\'s not the time. You\'ll be okay... just, you need to lie (still)--'},
      {type: types.EMPTYLINE, line: 52},
      {type: types.CONDITIONAL_END, line: 53},
      {type: types.EMPTYLINE, line: 54},
      {type: types.CONDITIONAL, line: 55, value: 'SampleScene_Choice01_03'},
      {type: types.EMPTYLINE, line: 56},
      {type: types.STRING, line: 57, value: 'CLAIRE'},
      {type: types.STRING, line: 58, value: 'What\'s that matter now?'},
      {type: types.EMPTYLINE, line: 59},
      {type: types.STRING, line: 60, value: 'JACK'},
      {type: types.STRING, line: 61, value: 'You\'re going to be fine... do you understand? We just need to get you out (of)--'},
      {type: types.EMPTYLINE, line: 62},
      {type: types.CONDITIONAL_END, line: 63},
      {type: types.EMPTYLINE, line: 64},
      {type: types.CONDITIONAL, line: 65, value: 'SampleScene_Choice01_Silence'},
      {type: types.EMPTYLINE, line: 66},
      {type: types.STRING, line: 67, value: 'JACK'},
      {type: types.STRING, line: 68, value: 'You\'re going to be fine, I just need you to listen now. Just stay (still)--'},
      {type: types.EMPTYLINE, line: 69},
      {type: types.CONDITIONAL_END, line: 70},
      {type: types.EMPTYLINE, line: 71},
      {type: types.STRING, line: 72, value: 'CLAIRE'},
      {type: types.PARENTHETICAL, line: 73, value: 'wincing in pain'},
      {type: types.STRING, line: 74, value: 'There... God, that\'s a big one!'},
      {type: types.EMPTYLINE, line: 75},
      {type: types.CONDITIONAL, line: 76, value: 'SampleScene_Choice01_Silence'},
      {type: types.EMPTYLINE, line: 77},
      {type: types.STRING, line: 78, value: 'JACK'},
      {type: types.PARENTHETICAL, line: 79, value: 'looks up, calls out'},
      {type: types.STRING, line: 80, value: 'YOU! COME HERE!'},
      {type: types.EMPTYLINE, line: 81},
      {type: types.STRING, line: 82, value: 'JACK (O.S.) (IDLE)'},
      {type: types.STRING, line: 83, value: 'I need you to get this woman away from these fumes!'},
      {type: types.EMPTYLINE, line: 84},
      {type: types.CHOICE, line: 85, value: 'Another Choice #1'},
      {type: types.CHOICE_FACT, line: 86, value: 'SampleScene_Choice02_01'},
      {type: types.CHOICE, line: 87, value: 'Another Choice #2'},
      {type: types.CHOICE_FACT, line: 88, value: 'SampleScene_Choice02_02'},
      {type: types.CONDITIONAL, line: 89, value: 'TestFactForChoice'},
      {type: types.CHOICE, line: 90, value: 'Another Choice #3'},
      {type: types.CHOICE_FACT, line: 91, value: 'SampleScene_Choice02_03'},
      {type: types.CONDITIONAL_END, line: 92},
      {type: types.CHOICE, line: 93, value: 'Another Choice #4'},
      {type: types.CHOICE_FACT, line: 94, value: 'SampleScene_Choice02_04'},
      {type: types.CHOICE, line: 95, value: '[silence]'},
      {type: types.CHOICE_FACT, line: 96, value: 'SampleScene_Choice02_Silence'},
      {type: types.EMPTYLINE, line: 97},
      {type: types.CONDITIONAL, line: 98, value: 'SampleScene_Choice02_01'},
      {type: types.EMPTYLINE, line: 99},
      {type: types.STRING, line: 100, value: 'And Hurley does -- in this moment he might just follow anyone anywhere -- Jack rips off his watch, gives it to him:'},
      {type: types.EMPTYLINE, line: 101},
      {type: types.STRING, line: 102, value: 'HURLEY'},
      {type: types.STRING, line: 103, value: 'Okay-- Okay--'},
      {type: types.EMPTYLINE, line: 104},
      {type: types.STRING, line: 105, value: 'JACK'},
      {type: types.STRING, line: 106, value: 'I\'ll be back soon.'},
      {type: types.EMPTYLINE, line: 107},
      {type: types.CONDITIONAL_END, line: 108},
      {type: types.EMPTYLINE, line: 109},
      {type: types.CONDITIONAL, line: 110, value: 'SampleScene_Choice02_02'},
      {type: types.EMPTYLINE, line: 111},
      {type: types.STRING, line: 112, value: 'HURLEY'},
      {type: types.STRING, line: 113, value: 'You gotta be kidding me--'},
      {type: types.EMPTYLINE, line: 114},
      {type: types.STRING, line: 115, value: 'JACK'},
      {type: types.STRING, line: 116, value: 'Take her over there! Then, stay with her! Don\'t let her move!'},
      {type: types.EMPTYLINE, line: 117},
      {type: types.CONDITIONAL_END, line: 118},
      {type: types.EMPTYLINE, line: 119},
      {type: types.CONDITIONAL, line: 120, value: 'SampleScene_Choice02_03'},
      {type: types.EMPTYLINE, line: 121},
      {type: types.STRING, line: 122, value: 'HURLEY'},
      {type: types.STRING, line: 123, value: 'Hey, what\'s your name?!'},
      {type: types.EMPTYLINE, line: 124},
      {type: types.STRING, line: 125, value: 'JACK'},
      {type: types.STRING, line: 126, value: 'Look, if her contractions occur closer than three minutes apart, call out for me!'},
      {type: types.PARENTHETICAL, line: 127, value: 'beat'},
      {type: types.STRING, line: 128, value: 'Jack!'},
      {type: types.EMPTYLINE, line: 129},
      {type: types.CONDITIONAL_END, line: 130},
      {type: types.EMPTYLINE, line: 131},
      {type: types.CONDITIONAL, line: 132, value: 'SampleScene_Choice02_Silence'},
      {type: types.EMPTYLINE, line: 133},
      {type: types.STRING, line: 134, value: 'JACK'},
      {type: types.STRING, line: 135, value: 'I need your help! Stay here with her and I\'ll be back!'},
      {type: types.EMPTYLINE, line: 136},
      {type: types.CONDITIONAL_END, line: 137},
      {type: types.EMPTYLINE, line: 138},
      {type: types.CONDITIONAL_END, line: 139},
      {type: types.EMPTYLINE, line: 140},
      {type: types.STRING, line: 141, value: 'This is some more test action descriptions. Next are some more complex compound/nested conditional blocks.'},
      {type: types.EMPTYLINE, line: 142},
      {type: types.CONDITIONAL, line: 143, value: 'TestFact'},
      {type: types.CONDITIONAL, line: 143, value: 'SampleScene_Choice01_03'},
      {type: types.EMPTYLINE, line: 144},
      {type: types.STRING, line: 145, value: 'JACK'},
      {type: types.STRING, line: 146, value: 'Stop-- her head\'s not tilted far back enough-- you\'re blowing air into her stomach--'},
      {type: types.EMPTYLINE, line: 147},
      {type: types.CONDITIONAL, line: 148, value: 'TestFact02'},
      {type: types.CONDITIONAL, line: 148, value: '!SampleScene_Choice01_01'},
      {type: types.EMPTYLINE, line: 149},
      {type: types.STRING, line: 150, value: 'BOONE'},
      {type: types.STRING, line: 151, value: 'Are you sure? I\'m a lifeguard! I\'m licensed!'},
      {type: types.EMPTYLINE, line: 152},
      {type: types.CONDITIONAL_END, line: 153},
      {type: types.EMPTYLINE, line: 154},
      {type: types.CONDITIONAL_END, line: 155},
      {type: types.EMPTYLINE, line: 156},
      {type: types.CONDITIONAL, line: 157, value: 'TestFact|SampleScene_Choice01_03'},
      {type: types.EMPTYLINE, line: 158},
      {type: types.STRING, line: 159, value: 'JACK'},
      {type: types.STRING, line: 160, value: 'You seriously need to think about giving back that license...'},
      {type: types.EMPTYLINE, line: 161},
      {type: types.CONDITIONAL_END, line: 162},
      {type: types.EMPTYLINE, line: 163},
      {type: types.CONDITIONAL, line: 164, value: 'TestFact'},
      {type: types.CONDITIONAL, line: 164, value: 'SampleScene_Choice01_03|TestFact2'},
      {type: types.EMPTYLINE, line: 165},
      {type: types.STRING, line: 166, value: 'BOONE'},
      {type: types.STRING, line: 167, value: 'That\'s exactly what I was doing!'},
      {type: types.EMPTYLINE, line: 168},
      {type: types.CONDITIONAL_END, line: 169},
      {type: types.EMPTYLINE, line: 170},
      {type: types.CONDITIONAL_BARK, line: 171, value: 'BarkFact'},
      {type: types.CONDITIONAL_BARK, line: 171, value: 'BarkFact2'},
      {type: types.EMPTYLINE, line: 172},
      {type: types.STRING, line: 173, value: 'BOONE (O.S.)'},
      {type: types.STRING, line: 174, value: 'Hey man, she\'s still not breathing!'},
      {type: types.PARENTHETICAL, line: 175, value: 'beat'},
      {type: types.STRING, line: 176, value: 'Maybe we need to do one of those hole things-- where you stick a pen in her throat?'},
      {type: types.EMPTYLINE, line: 177},
      {type: types.CONDITIONAL_END, line: 178},
      {type: types.EMPTYLINE, line: 179},
      {type: types.CONDITIONAL_OPEN, line: 180, value: 'OpenFact'},
      {type: types.EMPTYLINE, line: 181},
      {type: types.STRING, line: 182, value: 'JACK'},
      {type: types.STRING, line: 183, value: 'Yeah, good idea-- you go get me a pen!'},
      {type: types.EMPTYLINE, line: 184},
      {type: types.CONDITIONAL_END, line: 185},
    ]);
  });
  