Skip to content

Commit

Permalink
Bugfix #7490/Fix broken ampersand (#70)
Browse files Browse the repository at this point in the history
* added unit tests to check behavior of original quote parsing.

* fixed issue that flattening tWords tags in original language loses space.
added unit tests to check behavior of original quote parsing.
moved code from tc-source-content-updater
export wordOccurrenceHelpers

* clean up

* add more test cases
  • Loading branch information
PhotoNomad0 authored Mar 27, 2023
1 parent d80f2f3 commit a0b04d6
Show file tree
Hide file tree
Showing 15 changed files with 22,422 additions and 14 deletions.
367 changes: 367 additions & 0 deletions __tests__/__snapshots__/tsvToGroupdataSingle.test.js.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,367 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`tsvToGroupData() - testing quotes Test -1 occurrence 1`] = `"καὶ"`;

exports[`tsvToGroupData() - testing quotes Test all occurrences 1`] = `"καὶ"`;

exports[`tsvToGroupData() - testing quotes Test fifth occurrence 1`] = `"καὶ"`;

exports[`tsvToGroupData() - testing quotes Test multiple ellipsis 1`] = `
Array [
Object {
"occurrence": 1,
"word": "τοῖς",
},
Object {
"word": "",
},
Object {
"occurrence": 1,
"word": "καὶ",
},
Object {
"word": "",
},
Object {
"occurrence": 2,
"word": "τοῖς",
},
Object {
"word": "",
},
Object {
"occurrence": 2,
"word": "καὶ",
},
]
`;

exports[`tsvToGroupData() - testing quotes Test multiple ellipsis 2 1`] = `
Array [
Object {
"occurrence": 1,
"word": "τοῖς",
},
Object {
"word": "",
},
Object {
"occurrence": 1,
"word": "καὶ",
},
Object {
"word": "",
},
Object {
"occurrence": 2,
"word": "τοῖς",
},
Object {
"word": "",
},
Object {
"occurrence": 2,
"word": "καὶ",
},
Object {
"word": "",
},
Object {
"occurrence": 3,
"word": "τοῖς",
},
Object {
"word": "",
},
Object {
"occurrence": 3,
"word": "καὶ",
},
]
`;

exports[`tsvToGroupData() - testing quotes Test multiple ellipsis 3 1`] = `
Array [
Object {
"occurrence": 1,
"word": "τοῖς",
},
Object {
"word": "",
},
Object {
"occurrence": 1,
"word": "καὶ",
},
Object {
"word": "",
},
Object {
"occurrence": 2,
"word": "τοῖς",
},
Object {
"word": "",
},
Object {
"occurrence": 2,
"word": "καὶ",
},
Object {
"word": "",
},
Object {
"occurrence": 3,
"word": "τοῖς",
},
Object {
"word": "",
},
Object {
"occurrence": 3,
"word": "καὶ",
},
Object {
"word": "",
},
Object {
"occurrence": 4,
"word": "τοῖς",
},
Object {
"word": "",
},
Object {
"occurrence": 4,
"word": "καὶ",
},
]
`;

exports[`tsvToGroupData() - testing quotes Test multiple ellipsis and phrases 1`] = `
Array [
Object {
"occurrence": 1,
"word": "τοῖς",
},
Object {
"occurrence": 1,
"word": "καθαροῖς",
},
Object {
"word": "",
},
Object {
"occurrence": 1,
"word": "καὶ",
},
Object {
"occurrence": 1,
"word": "ἀπίστοις",
},
Object {
"word": "",
},
Object {
"occurrence": 3,
"word": "τοῖς",
},
Object {
"occurrence": 2,
"word": "καθαροῖς",
},
Object {
"word": "",
},
Object {
"occurrence": 2,
"word": "καὶ",
},
Object {
"occurrence": 2,
"word": "ἀπίστοις",
},
]
`;

exports[`tsvToGroupData() - testing quotes Test second occurrence 1`] = `"καὶ"`;

exports[`tsvToGroupData() - testing quotes Test simple ampersand 1`] = `
Array [
Object {
"occurrence": 1,
"word": "καθαροῖς",
},
Object {
"word": "",
},
Object {
"occurrence": 2,
"word": "τοῖς",
},
]
`;

exports[`tsvToGroupData() - testing quotes Test simple ampersand 2 1`] = `
Array [
Object {
"occurrence": 2,
"word": "τοῖς",
},
Object {
"word": "",
},
Object {
"occurrence": 1,
"word": "καὶ",
},
]
`;

exports[`tsvToGroupData() - testing quotes Test simple ampersand 3 1`] = `
Array [
Object {
"occurrence": 1,
"word": "καὶ",
},
Object {
"word": "",
},
Object {
"occurrence": 1,
"word": "ἐν",
},
]
`;

exports[`tsvToGroupData() - testing quotes Test simple ampersand with tWord tag 1`] = `
Array [
Object {
"occurrence": 1,
"word": "καὶ",
},
Object {
"word": "",
},
Object {
"occurrence": 2,
"word": "ἐν",
},
]
`;

exports[`tsvToGroupData() - testing quotes Test simple ampersand with verse range 1`] = `
Array [
Object {
"occurrence": 1,
"word": "καὶ",
},
Object {
"word": "",
},
Object {
"occurrence": 3,
"word": "ἐν",
},
]
`;

exports[`tsvToGroupData() - testing quotes Test simple ampersand with verse range 2 1`] = `
Array [
Object {
"occurrence": 1,
"word": "δοῦλοι",
},
Object {
"word": "",
},
Object {
"occurrence": 1,
"word": "Ἰησοῦ",
},
]
`;

exports[`tsvToGroupData() - testing quotes Test simple ampersand with verse range 3 1`] = `
Array [
Object {
"occurrence": 1,
"word": "Χριστῷ",
},
Object {
"word": "",
},
Object {
"occurrence": 2,
"word": "Ἰησοῦ",
},
]
`;

exports[`tsvToGroupData() - testing quotes Test simple ampersand with verse range 4 1`] = `
Array [
Object {
"occurrence": 1,
"word": "ἡμῶν",
},
Object {
"word": "",
},
Object {
"occurrence": 2,
"word": "Χριστοῦ",
},
]
`;

exports[`tsvToGroupData() - testing quotes Test simple ampersand with verse range and tWord tag 1`] = `
Array [
Object {
"occurrence": 1,
"word": "καὶ",
},
Object {
"word": "",
},
Object {
"occurrence": 1,
"word": "ἐν",
},
Object {
"occurrence": 1,
"word": "Χριστῷ",
},
]
`;

exports[`tsvToGroupData() - testing quotes Test simple ellipsis 1`] = `
Array [
Object {
"occurrence": 2,
"word": "τοῖς",
},
Object {
"word": "",
},
Object {
"occurrence": 1,
"word": "καὶ",
},
]
`;

exports[`tsvToGroupData() - testing quotes Test three dot with verse range 1`] = `
Array [
Object {
"occurrence": 1,
"word": "ἡμῶν",
},
Object {
"word": "",
},
Object {
"occurrence": 2,
"word": "Χριστοῦ",
},
]
`;
Loading

0 comments on commit a0b04d6

Please sign in to comment.