Add test for emoji modifiers and ZWJ
diff --git a/test/test.js b/test/test.js
index a6be349..8c2ce1d 100644
--- a/test/test.js
+++ b/test/test.js
@@ -40,6 +40,30 @@
expect(lines_count).toBe(6202);
done();
});
+
+ test('Regression test for issue #113: emoji modifiers and ZWJ', (done) => {
+ // Test that compound emojis with modifiers and ZWJ are recognized as single EMOIMG tokens
+ const testInput = `# foundry = base
+# text_id = test-113
+# text = ✊🏿 and 👨👨👦
+1 ✊🏿 _ _ _ _ _ _ _ _
+2 and _ CCONJ _ _ _ _ _ _
+3 👨👨👦 _ _ _ _ _ _ _ _
+
+`;
+ const { execSync } = require('child_process');
+ const stdout = execSync('node src/index.js', { input: testInput }).toString();
+
+ // Check that compound emojis are tagged as EMOIMG
+ expect(stdout).toContain('✊🏿\t_\tEMOIMG\tEMOIMG');
+ expect(stdout).toContain('👨👨👦\t_\tEMOIMG\tEMOIMG');
+
+ // Count EMOIMG occurrences (should be 2 for each emoji - columns 3 and 4)
+ var emoimg_count = (stdout.match(/EMOIMG/g) || []).length;
+ expect(emoimg_count).toBe(4); // 2 emojis × 2 columns = 4
+ done();
+ });
+
test('Regression test for issue #114: Wikipedia emoji templates', (done) => {
// Test that Wikipedia emoji templates are recognized as EMOWIKI tokens
const testInput = `# foundry = base