{"size": 2925, "ext": "js", "max_stars_repo_path": "test/test.js", "max_stars_repo_name": "TopCli/text-align", "max_stars_repo_stars_event_min_datetime": "2020-04-20T20:48:00.000Z", "max_stars_repo_stars_event_max_datetime": "2020-04-20T20:48:00.000Z", "max_issues_repo_path": "test/test.js", "max_issues_repo_name": "SlimIO/text-align", "max_issues_repo_issues_event_min_datetime": "2021-11-28T14:11:28.000Z", "max_issues_repo_issues_event_max_datetime": "2021-11-28T14:12:25.000Z", "max_forks_repo_path": "test/test.js", "max_forks_repo_name": "TopCli/text-align", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": 1, "max_forks_count": null, "avg_line_length": 22.3282442748, "max_line_length": 60, "alphanum_fraction": 0.5671794872}
// Import Third-party Dependencies
import test from "tape";

// Import Internal Dependencies
import * as align from "../index.js";

test("center narrow", (tape) => {
  tape.strictEqual(align.center("abc", 10), "   abc    ");
  tape.end();
});

test("center wide", (tape) => {
  tape.strictEqual(align.center("古古古", 10), "  古古古  ");
  tape.end();
});

test("left narrow", (tape) => {
  tape.strictEqual(align.left("abc", 10), "abc       ");
  tape.end();
});

test("left wide", (tape) => {
  tape.strictEqual(align.left("古古古", 10), "古古古    ");
  tape.end();
});

test("right narrow", (tape) => {
  tape.strictEqual(align.right("abc", 10), "       abc");
  tape.end();
});

test("right narrow", (tape) => {
  tape.strictEqual(align.right("古古古", 10), "    古古古");
  tape.end();
});

// overflow
test("center narrow overflow", (tape) => {
  tape.strictEqual(align.center("abc", 2), "abc");
  tape.end();
});

test("center wide overflow", (tape) => {
  tape.strictEqual(align.center("古古古", 4), "古古古");
  tape.end();
});

test("left narrow overflow", (tape) => {
  tape.strictEqual(align.left("abc", 2), "abc");
  tape.end();
});

test("left wide overflow", (tape) => {
  tape.strictEqual(align.left("古古古", 4), "古古古");
  tape.end();
});

test("right narrow overflow", (tape) => {
  tape.strictEqual(align.right("abc", 2), "abc");
  tape.end();
});

test("right narrow overflow", (tape) => {
  tape.strictEqual(align.right("古古古", 4), "古古古");
  tape.end();
});

// nothing
test("left align nothing", (tape) => {
  tape.strictEqual(align.left("", 5), "     ");
  tape.end();
});

test("center align nothing", (tape) => {
  tape.strictEqual(align.center("", 5), "     ");
  tape.end();
});

test("right align nothing", (tape) => {
  tape.strictEqual(align.right("", 5), "     ");
  tape.end();
});

// whitespace
test("left align whitespace", (tape) => {
  tape.strictEqual(align.left("   ", 5), "     ");
  tape.end();
});

test("center align whitespace", (tape) => {
  tape.strictEqual(align.center("   ", 5), "     ");
  tape.end();
});

test("right align whitespace", (tape) => {
  tape.strictEqual(align.right("   ", 5), "     ");
  tape.end();
});

// whitespace overflow
test("left align whitespace overflow", (tape) => {
  tape.strictEqual(align.left("   ", 2), "   ");
  tape.end();
});

test("center align whitespace overflow", (tape) => {
  tape.strictEqual(align.center("   ", 2), "   ");
  tape.end();
});

test("right align whitespace overflow", (tape) => {
  tape.strictEqual(align.right("   ", 2), "   ");
  tape.end();
});

// whitespace mix
test("left align whitespace mix", (tape) => {
  tape.strictEqual(align.left("  x  ", 10), "  x       ");
  tape.end();
});

test("center align whitespace mix", (tape) => {
  tape.strictEqual(align.center("  x  ", 10), "    x     ");
  tape.end();
});

test("right align whitespace mix", (tape) => {
  tape.strictEqual(align.right("  x  ", 10), "       x  ");
  tape.end();
});
