<commit_before>import selftest from '../selftest';
import { parse, markBottom } from '../parse-stack';
import _ from 'underscore';
import Fiber from 'fibers';
import Future from 'fibers/future';

selftest.define("parse-stack - parse stack traces without fibers", () => {
  const err = new Error();
  const parsedStack = parse(err);

  selftest.expectEqual(_.last(parsedStack[0].file.split("/")),
    "parse-stack-test.js");

  markBottom(() => {
    const markedErr = new Error();
    const parsedStack = parse(markedErr);

    // The stack trace should only contain this one function since we marked the
    // bottom
    selftest.expectEqual(parsedStack.length, 1);
    selftest.expectEqual(_.last(parsedStack[0].file.split("/")),
      "parse-stack-test.js");
  })();
});<commit_msg>Add comment for future work<commit_after>import selftest from '../selftest';
import { parse, markBottom } from '../parse-stack';
import _ from 'underscore';
import Fiber from 'fibers';
import Future from 'fibers/future';

selftest.define("parse-stack - parse stack traces without fibers", () => {
  const err = new Error();
  const parsedStack = parse(err);

  selftest.expectEqual(_.last(parsedStack[0].file.split("/")),
    "parse-stack-test.js");

  markBottom(() => {
    const markedErr = new Error();
    const parsedStack = parse(markedErr);

    // The stack trace should only contain this one function since we marked the
    // bottom
    selftest.expectEqual(parsedStack.length, 1);
    selftest.expectEqual(_.last(parsedStack[0].file.split("/")),
      "parse-stack-test.js");
  })();
});

// XXX I really want to add a test here for the crazy double-stack-trace Fiber
// situation, but I don't know how to create it inside a test.
{'fraction_non_alphanumeric': 0.14979757085020243, 'fraction_numerical': 0.003470213996529786, 'mean_word_length': 3.84593837535014, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2953192', 'n_tokens_mistral': 521, 'n_tokens_neox': 516, 'n_words': 152}