如何获得cosmic_ray报告的图形差异?

时间:2018-10-21 21:32:04

标签: meld difftool

Cosmic ray是一个Python突变测试工具,可以为我提供以下形式的输出

job ID daf633b389af41cea2ddce3cbec6c572:survived:mpu.shell
command: cosmic-ray worker mpu.shell core/ReplaceComparisonOperator_Gt_LtE 0
--- mutation diff ---
--- a/home/moose/GitHub/mpu/mpu/shell.py
+++ b/home/moose/GitHub/mpu/mpu/shell.py
@@ -68,7 +68,7 @@

 def text_input(text):
     '\n    Ask the user for textual input.\n\n    Parameters\n    ----------\n    text : str\n        What the user sees.\n\n    Returns\n    -------\n    inputed_text : str\n        What the user wrote.\n    '
-    if (sys.version_info > (3, 0)):
+    if (sys.version_info <= (3, 0)):
         return input(text)
     else:
         return raw_input(text)

job ID 68d0a853622e486384e281c19fb54f41:survived:mpu.shell
command: cosmic-ray worker mpu.shell core/ReplaceComparisonOperator_Gt_NotIn 0
--- mutation diff ---
--- a/home/moose/GitHub/mpu/mpu/shell.py
+++ b/home/moose/GitHub/mpu/mpu/shell.py
@@ -68,7 +68,7 @@

 def text_input(text):
     '\n    Ask the user for textual input.\n\n    Parameters\n    ----------\n    text : str\n        What the user sees.\n\n    Returns\n    -------\n    inputed_text : str\n        What the user wrote.\n    '
-    if (sys.version_info > (3, 0)):
+    if (sys.version_info not in (3, 0)):
         return input(text)
     else:
         return raw_input(text)

我将其另存为cosmic_ray.diff文本文件,并希望对其进行并排浏览。

该文件是下列条目的列表:

job ID [some id]
command: [some command]
--- mutation diff ---
--- [first file name]
+++ [second file name]
[usual diff]

我喜欢将mel作为差异工具,但是meld --comparison-file cosmic_ray.diff似乎不起作用。这不是通常的差异格式吗?

1 个答案:

答案 0 :(得分:0)

在撰写此问题时,宇宙射线的产生突变和差异的方法不好。我相信他们现在已经改变了这一点,而且还不错。

话虽如此,请尝试使用Mutmut!这是我的突变测试仪,并且与我合作非常愉快,因为我非常关心用户体验。