<commit_before>import { Frame } from "../../src/frames/frame";
import { FrameString } from "../../src/frames/frame-string";
import { FrameExpr } from "../../src/frames/frame-expr";
import { FrameSymbol } from "../../src/frames/frame-symbol";
import * as chai from "chai";
const expect = chai.expect;

describe("FrameExpr", () => {
  const frame = new Frame();
  const js_string = "Hello";
  const frame_string = new FrameString(js_string);
  const frame_expr = new FrameExpr([frame, frame_string])

  it("stringifies with parentheses", () => {
    expect(frame_expr.toString()).to.equal(`(() “${js_string}”)`);
  });

  it("replaces nil when called", () => {
    const result = frame_expr.call(frame);
    expect(result).to.equal(frame_string);
  });

  it("concatenates string expressions when called", () => {
    const js_string_2 = ", MAML!";
    const frame_string_2 = new FrameString(js_string_2);
    const frame_expr_2 = new FrameExpr([frame_string, frame_string_2]);
    const result = frame_expr_2.call(frame);

    expect(result.toString()).to.equal(`“${js_string}${js_string_2}”`);
  });

  it("returns context for FrameSymbol.here", () => {
    const context = new Frame({context: frame_string});
    const frame_expr = new FrameExpr([FrameSymbol.here()]);
    const result = frame_expr.call(context);

    expect(result).to.equal(context);<commit_msg>cleanup frame-expo-spec<commit_after>import { expect } from "chai";
import { Frame, FrameString, FrameExpr, FrameSymbol} from "../../src/frames";

describe("FrameExpr", () => {
  const frame = new Frame();
  const js_string = "Hello";
  const frame_string = new FrameString(js_string);
  const frame_expr = new FrameExpr([frame, frame_string])

  it("stringifies with parentheses", () => {
    expect(frame_expr.toString()).to.equal(`(() “${js_string}”)`);
  });

  it("replaces nil when called", () => {
    const result = frame_expr.call(frame);
    expect(result).to.equal(frame_string);
  });

  it("concatenates string expressions when called", () => {
    const js_string_2 = ", MAML!";
    const frame_string_2 = new FrameString(js_string_2);
    const frame_expr_2 = new FrameExpr([frame_string, frame_string_2]);
    const result = frame_expr_2.call(frame);

    expect(result.toString()).to.equal(`“${js_string}${js_string_2}”`);
  });

  it("returns context for FrameSymbol.here", () => {
    const context = new Frame({context: frame_string});
    const frame_expr = new FrameExpr([FrameSymbol.here()]);
    const result = frame_expr.call(context);

    expect(result).to.equal(context);
{'fraction_non_alphanumeric': 0.17238689547581904, 'fraction_numerical': 0.00546021840873635, 'mean_word_length': 4.4, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '3927346', 'n_tokens_mistral': 810, 'n_tokens_neox': 796, 'n_words': 171}