updated 调整关系替换顺序,避免数据冗余

This commit is contained in:
mumuy
2017-02-03 09:39:01 +08:00
parent 06669774b2
commit 0e2e7502ba
5 changed files with 83 additions and 82 deletions

View File

@@ -13,6 +13,7 @@ test('relationship.js show to be tested', function (t) {
t.deepEqual(relationship({text:'表姐的哥哥',sex:1}),['姑表哥','舅表哥','姨表哥']);
t.deepEqual(relationship({text:'表姐的妹妹',sex:1}),['姑表姐','姑表妹','舅表姐','舅表妹','姨表姐','姨表妹']);
t.deepEqual(relationship({text:'老公的老婆的儿子的爸爸',sex:0}),['老公']);
t.deepEqual(relationship({text:'哥哥的弟弟的爸爸的儿子',sex:1}),['兄弟','自己']);
t.deepEqual(relationship({text:'爸爸的舅舅',sex:0,reverse:true}),['外甥孙女']);
t.deepEqual(relationship({text:'舅爷爷',type:'chain'}),['爸爸的妈妈的兄弟']);