http://qs321.pair.com?node_id=11122856


in reply to Re^4: remove first and last character of string (updated)
in thread remove first and last character of string

Let us assume you were confused because you weren't expecting tests.

A piece of code which accepts input and produces output is useful to the end user, but slightly less so to the developer trying to determine if a particular requirement of the code is met or not. Since your initial description of the problem is (and continues to be) very vague it is just about impossible for us or anyone else to produce a solution which matches precisely the unknown spec.

In such situations therefore, we produce instead a test. The test shows what output we expect for a given input, analyses the result of the code we use to try to satisfy the test and outputs the result of that test (using TAP - which is the output you have quoted here).

Here are some pages for you to read to undestand all this:

It may seem daunting and/or unnecessary now but it will help you a great deal in the long run.


🦛