<commit_before>import {
	NARROW_BAR,
	NARROW_SPACE,
	WIDE_BAR,
	WIDE_SPACE
} from "../../Core/Characters"
import {
	encodeCode39,
	Mapping
} from "../Code39"

describe("encodeCode39", function () {
	describe("Delimiters", function () {
		it("starts the barcode with a start/stop code", function () {
			const code = encodeCode39("")
			expect(code.substr(0, 9)).toEqual(Mapping["*"])
		})

		it("ends the barcode with a start/stop code", function () {
			const code = encodeCode39("")
			expect(code.substr(-9)).toEqual(Mapping["*"])
		})
	})

	it("separates codes with a narrow space", function () {
		const code = encodeCode39("")
		expect(code.substr(9, 1)).toEqual("n")
	})

	it("matches the snapshot for the full alphabet", function () {
		const code = encodeCode39(Object.keys(Mapping).filter(it => it !== "*").sort().join(""))
		expect(code).toMatchSnapshot()
	})

	describe("Mapping", function () {
		it("has 39 + 1 codes", function () {
			expect(Object.keys(Mapping).length).toEqual(40)
		})

		Object.keys(Mapping).map(char => {
			it(`matches the snapshot for '${char}'`, function () {
				expect(Mapping[char]).toMatchSnapshot()
			})

			it(`maps '${char}' to 5 bars`, function () {
				expect(Mapping[char].split("").filter(it => it === NARROW_BAR || it === WIDE_BAR)).toHaveLength(5)
			})

			it(`maps '${char}' to 4 spaces`, function () {
				expect(Mapping[char].split("").filter(it => it === NARROW_SPACE || it === WIDE_SPACE)).toHaveLength(4)
			})
		})
	})
})<commit_msg>Test for lowercase input strings<commit_after>import {
	NARROW_BAR,
	NARROW_SPACE,
	WIDE_BAR,
	WIDE_SPACE
} from "../../Core/Characters"
import {
	encodeCode39,
	Mapping
} from "../Code39"

describe("encodeCode39", function () {
	describe("Delimiters", function () {
		it("starts the barcode with a start/stop code", function () {
			const code = encodeCode39("")
			expect(code.substr(0, 9)).toEqual(Mapping["*"])
		})

		it("ends the barcode with a start/stop code", function () {
			const code = encodeCode39("")
			expect(code.substr(-9)).toEqual(Mapping["*"])
		})
	})

	it("separates codes with a narrow space", function () {
		const code = encodeCode39("")
		expect(code.substr(9, 1)).toEqual("n")
	})

	it("matches the snapshot for the full alphabet", function () {
		const code = encodeCode39(Object.keys(Mapping).filter(it => it !== "*").sort().join(""))
		expect(code).toMatchSnapshot()
	})

	it("uppercases input strings", function () {
		const code = encodeCode39("a")
		expect(code).not.toEqual(expect.stringContaining(Mapping["-"]))
	})

	describe("Mapping", function () {
		it("has 39 + 1 codes", function () {
			expect(Object.keys(Mapping).length).toEqual(40)
		})

		Object.keys(Mapping).map(char => {
			it(`matches the snapshot for '${char}'`, function () {
				expect(Mapping[char]).toMatchSnapshot()
			})

			it(`maps '${char}' to 5 bars`, function () {
				expect(Mapping[char].split("").filter(it => it === NARROW_BAR || it === WIDE_BAR)).toHaveLength(5)
			})

			it(`maps '${char}' to 4 spaces`, function () {
				expect(Mapping[char].split("").filter(it => it === NARROW_SPACE || it === WIDE_SPACE)).toHaveLength(4)
			})
		})
	})
})
{'fraction_non_alphanumeric': 0.20031695721077655, 'fraction_numerical': 0.01838351822503962, 'mean_word_length': 4.26, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '1337071', 'n_tokens_mistral': 1187, 'n_tokens_neox': 1056, 'n_words': 222}