<commit_before>'use strict';

const assert = require("chai").assert;
const pogo = require('../index.js'),
      alts = pogo.alts,
      chan = pogo.chan,
      put = pogo.put;
const wtf = x => console.log("wtf", x);
const sleep = ms => new Promise(yep => setTimeout(yep, ms));

describe("returning a value", () => {
  it("resolves the pogo's promise", () => {
    return pogo(function*() { return 123; }).then(v => assert.equal(v, 123)); });
});

describe("raising an exception", () => {
  it("rejects the pogo's promise", () => {
    return pogo(function*() { throw "bang!"; }).catch(e => assert.equal(e, "bang!"));
  });
});

describe("yielding a promise", () => {
  describe("that resolves", () => {
    it("resumes the pogo with the resolution", () => {
      return pogo(function*() { assert.equal(yield Promise.resolve(123), 123)});<commit_msg>Naming.<commit_after>'use strict';

const assert = require("chai").assert;
const pogo = require('../index.js'),
      alts = pogo.alts,
      chan = pogo.chan,
      put = pogo.put;
const wtf = x => console.log("wtf", x);
const sleep = ms => new Promise(awaken => setTimeout(awaken, ms));

describe("returning a value", () => {
  it("resolves the pogo's promise", () => {
    return pogo(function*() { return 123; }).then(v => assert.equal(v, 123)); });
});

describe("raising an exception", () => {
  it("rejects the pogo's promise", () => {
    return pogo(function*() { throw "bang!"; }).catch(e => assert.equal(e, "bang!"));
  });
});

describe("yielding a promise", () => {
  describe("that resolves", () => {
    it("resumes the pogo with the resolution", () => {
      return pogo(function*() { assert.equal(yield Promise.resolve(123), 123)});
{'fraction_non_alphanumeric': 0.22058823529411764, 'fraction_numerical': 0.01411764705882353, 'mean_word_length': 3.9161849710982657, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 27, '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': '565726', 'n_tokens_mistral': 602, 'n_tokens_neox': 565, 'n_words': 139}