[darcs-devel] Help needed with the test harness

Guillaume Hoffmann guillaumh at gmail.com
Thu Aug 10 01:29:09 UTC 2017


Thanks Ben!

I have a two questions to begin with:

* about "added a test for switching between encodings".Could you add
more comments in this test script? We already have send-encoding.sh
and switch-encoding.sh , what does your script test that these others
do not?
* is there a way to test the changes of "in Darcs.UI.Commands import
setEnv from System.Environment" and "removed redundant class
constraint for Darcs.UI.Commands.setEnvDarcsFiles" ?

Guillaume

2017-08-09 10:34 GMT-03:00 Benjamin Franksen <ben.franksen at online.de>:
> Hi Guillaume
>
> I am now finished with creating separate patch bundles for everything in
> bf at hub.darcs.net:bf/darcs-encoding that is unrelated to encoding and
> pushed all except one (that you can ignore for the moment) to screened.
> I also added a conflict resolution patch to the repo. It is now a mere
> 13 patches ahead of screened.
>
> Cheers
> Ben
>
> On 28.07.2017 15:47, Guillaume Hoffmann wrote:
>> Hi Ben!
>>
>> I'm going to look at your branch and comments soon, thank you!
>>
>> Guillaume
>>
>> 2017-07-26 19:22 GMT-03:00 Ben Franksen <ben.franksen at online.de>:
>>> Hi Guillaume
>>>
>>> nice to see you are back among the living ;-)
>>>
>>> Just so this won't be forgotten completely, let me ping you (and Ganesh,
>>> too!) with the request below I sent at the end of May. Let me repeat
>>> that I am open to proposals to improve what I did (wrt encoding,
>>> particularly of file names). I wouldn't even mind if you told me that I
>>> did it all completely wrong. What I do care about is that the issues are
>>> fixed (and I do think I have at least uncovered the crucial points where
>>> the current design gets it wrong and needs to be fixed).
>>>
>>> Cheers
>>> Ben
>>>
>>> Am 17.05.2017 um 11:24 schrieb Ben Franksen:
>>>> Hi Everyone
>>>>
>>>> as I explained on #darcs I am working on fixing the encoding business in
>>>> darcs. I have uploaded my working version as a fork of screened under
>>>> bf at hub.darcs.net:bf/darcs-encoding. It passes all (shell, network)
>>>> tests, with darcs1 and darcs2, including a new test I have written to
>>>> check that operations on the same repo behave consistently even when we
>>>> switch the locale charset from UTF-8 to C (ASCII) and back.
>>>>
>>>> However, I have problems with getting the test harness to compile that I
>>>> seem to be unable to solve without help.
>>>>
>>>> The problem is caused by a refactoring regarding Prim (V1) patches. I
>>>> was not satisfied with the way file names are displayed to the user when
>>>> they contain non-ASCII characters or spaces. I discovered that the
>>>> reason for this is that Prim(V1) patches had been made instances of
>>>> ShowPatch, ReadPatch, and PatchListFormat. But this is incorrect!
>>>>
>>>> Prim(V1) patches /cannot/ correctly implement these interfaces (and thus
>>>> also not the PrimPatch class etc), since the format of file names and
>>>> patch lists differs depending on whether the RepoPatch that uses them is
>>>> V1 or V2. On the other hand, large parts of the darcs code base,
>>>> including the unit and quickcheck tests for the patch system, depend on
>>>> being able to treat Prim patches very similar to RepoPatches. The only
>>>> manageable solution I found is to wrap Prim (V1) patches with a
>>>> RepoPatch-specific newtype (see Darcs.Patch.V1.Prim and
>>>> Darcs.Patch.V2.Prim). The wrapped types can now correctly implement the
>>>> above classes. They are what is now returned by the PrimOf type
>>>> function. A second type function RawPrimOf returns the actual Prim(V1)
>>>> patch (for FileUUID there is no wrapper and both are identical). The
>>>> latter is what actually gets created for the tests; I was able to adapt
>>>> the unit tests for RepoPatchV1 and RepoPatchV2 by traversing the
>>>> structures containing actual PrimV1 patches, wrapping each of them with
>>>> the appropriate newtype wrapper.
>>>>
>>>> But I was unable to do this for the tests that directly operate on Prim
>>>> patches. I am pretty sure it is possible, I just can't figure out at
>>>> which point to apply the wrappers because the types are so complicated...
>>>>
>>>> So the unit tests for Prim patches in my working version (qc_prim and
>>>> its use in harness/Darcs/Test/Patch.hs) are currently commented out. If
>>>> someone could look at my code and give me some hints...
>>>>
>>>> If you have questions regarding the design, just ask and I will explain
>>>> in detail what I changed and why. I am also open to criticism; I may
>>>> have complicated things unnecessarily, even though I tried very hard not
>>>> to. I learned a lot about the internal workings of darcs, to the point
>>>> where I have the feeling I have dug into each and every dark corner...
>>>> but I may still miss some of the higher level design ideas. And the
>>>> tests system's pervasive use of overloading and type level programming
>>>> makes it so difficult to understand what's going on that I have more or
>>>> less given up on that. I just want to get it working again and move on.
>>>>
>>>> Cheers
>>>> Ben
>>>>
>>>
>>>
>>> _______________________________________________
>>> darcs-devel mailing list
>>> darcs-devel at osuosl.org
>>> https://lists.osuosl.org/mailman/listinfo/darcs-devel
>
>
> _______________________________________________
> darcs-devel mailing list
> darcs-devel at osuosl.org
> https://lists.osuosl.org/mailman/listinfo/darcs-devel


More information about the darcs-devel mailing list