Skip to content

Commit

Permalink
fixup! test: consolidate utf8 text fixtures in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
joyeecheung committed Nov 14, 2023
1 parent 8937b68 commit b26fd59
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions test/common/fixtures.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,19 @@ function readFixtureKeys(enc, ...names) {
// This should be in sync with test/fixtures/utf8_test_text.txt.
// We copy them here as a string because this is supposed to be used
// in fs API tests.
const utf8TestText ='永和九年,嵗在癸丑,暮春之初,會於會稽山隂之蘭亭,脩稧事也。' +
'羣賢畢至,少長咸集。此地有崇山峻領,茂林脩竹;又有清流激湍,' +
'暎帶左右。引以為流觴曲水,列坐其次。雖無絲竹管弦之盛,一觴一詠,' +
'亦足以暢敘幽情。是日也,天朗氣清,恵風和暢;仰觀宇宙之大,' +
'俯察品類之盛;所以遊目騁懐,足以極視聽之娛,信可樂也。夫人之相與,' +
'俯仰一世,或取諸懐抱,悟言一室之內,或因寄所託,放浪形骸之外。' +
'雖趣舎萬殊,靜躁不同,當其欣扵所遇,暫得扵己,怏然自足,' +
'不知老之將至。及其所之既惓,情隨事遷,感慨係之矣。向之所欣,' +
'俛仰之閒以為陳跡,猶不能不以之興懐;況脩短隨化,終期扵盡。' +
'古人云:「死生亦大矣。」豈不痛哉!每攬昔人興感之由,若合一契,' +
'未嘗不臨文嗟悼,不能喻之扵懐。固知一死生為虛誕,齊彭殤為妄作。' +
'後之視今,亦由今之視昔,悲夫!故列敘時人,錄其所述,雖世殊事異,' +
'所以興懐,其致一也。後之攬者,亦將有感扵斯文。';
const utf8TestText = '永和九年,嵗在癸丑,暮春之初,會於會稽山隂之蘭亭,脩稧事也。' +
'羣賢畢至,少長咸集。此地有崇山峻領,茂林脩竹;又有清流激湍,' +
'暎帶左右。引以為流觴曲水,列坐其次。雖無絲竹管弦之盛,一觴一詠,' +
'亦足以暢敘幽情。是日也,天朗氣清,恵風和暢;仰觀宇宙之大,' +
'俯察品類之盛;所以遊目騁懐,足以極視聽之娛,信可樂也。夫人之相與,' +
'俯仰一世,或取諸懐抱,悟言一室之內,或因寄所託,放浪形骸之外。' +
'雖趣舎萬殊,靜躁不同,當其欣扵所遇,暫得扵己,怏然自足,' +
'不知老之將至。及其所之既惓,情隨事遷,感慨係之矣。向之所欣,' +
'俛仰之閒以為陳跡,猶不能不以之興懐;況脩短隨化,終期扵盡。' +
'古人云:「死生亦大矣。」豈不痛哉!每攬昔人興感之由,若合一契,' +
'未嘗不臨文嗟悼,不能喻之扵懐。固知一死生為虛誕,齊彭殤為妄作。' +
'後之視今,亦由今之視昔,悲夫!故列敘時人,錄其所述,雖世殊事異,' +
'所以興懐,其致一也。後之攬者,亦將有感扵斯文。';

module.exports = {
fixturesDir,
Expand All @@ -54,6 +54,6 @@ module.exports = {
readKeys: readFixtureKeys,
utf8TestText,
get utf8TestTextPath() {
return fixturesPath('utf8_test_text.txt')
}
return fixturesPath('utf8_test_text.txt');
},
};

0 comments on commit b26fd59

Please sign in to comment.