Skip to content

[Question][Hw1][Problem 8] make test on correct quine fails #14

@yusungsim

Description

@yusungsim

Hi. I finished problem 8, written quine and ran make test to check if it passes the test.

However, the diff command reports difference even if the output is same as the code.
I also found out that the test fails on the example quine code, too. (ie. quineEx.ml)

For representation purpose, I substituted quine.ml contents by quineEx.ml.

❯ make test
Done: 92/95 (jobs: 1)File "src/quine.ml", line 1, characters 0-0:
         git (internal) (exit 1)
(cd _build/default && /usr/bin/git --no-pager diff --no-index --color=always -u src/quine.ml test/quine.out)
diff --git a/src/quine.ml b/test/quine.out
index bf38527..1819a6e 100644
--- a/src/quine.ml
+++ b/test/quine.out
@@ -1 +1 @@
-(fun x -> Printf.printf "%s %S" x x) "(fun x -> Printf.printf \"%s %S\" x x)"
+(fun x -> Printf.printf "%s %S" x x) "(fun x -> Printf.printf \"%s %S\" x x)"
\ No newline at end of file
make: *** [test] Error 1

As you can see, the output is exactly same as the code, but diff reports difference.
The diff message says that output file has no newline at the end of file. But both sides actually does not have one.

I wonder how I can get around this problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions