Exercise "Pangram" has broken tests

This is the minimal example to break the tests:

        IDENTIFICATION DIVISION.
        PROGRAM-ID. PANGRAM.
        ENVIRONMENT DIVISION.
        DATA DIVISION.
        WORKING-STORAGE SECTION.
        01 WS-SENTENCE      PIC X(60).
        01 WS-RESULT        PIC 9.
        PROCEDURE DIVISION.
        PANGRAM.

      * Iteration 3: This is the minimum to break the tests.    
      
            goback.

@axtens added this exercise 2 years ago and might have an idea what’s wrong with the tests…maybe it’s another case of having the answer on the stack?

I expect it’s exactly that.

It’s on the list (along with a lot of other stuff), but I’ll give it a closer look in the next couple of days.

  1. 8th testing needs not to put the answer on the stack first
  2. cobol testing needs to have detect the presence of STOP RUN and GOBACK and complain about it. That or,
  • tweak cobolcheck to be able to handle those keywords, or
  • change to another unit test tool

So in COBOL it’s more like a test tool issue? In PHP we have a pre-step to lint the student code to prevent test tool breakage (see php-test-runner/bin/run.sh at ab11b7183ba3f1a382d0bed1049e802ddc785c3f · exercism/php-test-runner · GitHub). Maybe grep for those keywords before running the test tool?

Good idea. And someone even wrote me a demo of the idea. I just haven’t had the time.

1 Like