Giter VIP home page Giter VIP logo

Comments (9)

oldfartdeveloper avatar oldfartdeveloper commented on August 28, 2024 1

@milesfrain I'd like to tackle generating test suite for Ch. 4.

from purescript-book.

milesfrain avatar milesfrain commented on August 28, 2024 1

I updated the original post with links to tasks for adding tests for to each chapter.
I think the easiest workflow is to just post in that chapter's issue to claim it (instead of my previously suggested workflow of creating a new issue).

from purescript-book.

milesfrain avatar milesfrain commented on August 28, 2024 1

Do I open a global issue for the three, or one for each?

Thanks for the report @othelarian. Up to you on whether you want to create just a single issue or multiple issues. You can also just jump straight to submitting a PR with a potential fix (even if there's more work to be done), and we can discuss it further in the PR comments.

from purescript-book.

oldfartdeveloper avatar oldfartdeveloper commented on August 28, 2024

@milesfrain, I would be honored to go through through your tests on chapter 6 in #78.

I'll also be glad to write some tests for the preceding chapters. And the subsequent ones as well.

I've always found tests to be one of the best ways to wrap your head around a problem. I agree with you that tests "would also be a great help in improving book quality for upcoming readers".

Thanks for thinking of me.

from purescript-book.

milesfrain avatar milesfrain commented on August 28, 2024

@p2327 Also offered to help with test writing. Let's make sure we organize who's working on which chapters so we don't duplicate efforts.

from purescript-book.

oldfartdeveloper avatar oldfartdeveloper commented on August 28, 2024

@milesfrain @p2327 Sounds good. I'm currently attempting to verify your test suite at each increment of the exercises in Ch. 6.

from purescript-book.

p2327 avatar p2327 commented on August 28, 2024

@oldfartdeveloper I just started chapter 6 so happy for you to work on it instead if you are already started! I'll share my repo anyway be good to check my work with yours im quite a newbie :)

@milesfrain happy to take on other chapters as needed?

from purescript-book.

oldfartdeveloper avatar oldfartdeveloper commented on August 28, 2024

@p2327 Interestingly, I decided to pause my study of the book after finishing chapter 6 to divert to contribute tests for chapter 3 because I am so convinced that @milesfrain's efforts on adding the regression tests is such a great idea for readers like you and me.

@milesfrain has already completed implementing the tests for his solutions for chapter 6, and his they were invaluable in helping me to process the material in the chapter.

At this point in time, I'm ready to start studying chapter 7.

In terms of adding tests for solutions, chapters 3, 4, and 6 are complete.

So, would you like to take a stab at supplying the tests for your solutions for chapter 5? You've just finished studying the chapter, and so you're in a perfect position to cement your hard-won knowledge by adding the tests, and you have testing examples for 3 chapters now.

This would free me up to tackle studying chapter 7, and I would now proceed by doing "test-first" development for the examples. When I'm finished, there would be tests and solutions for chapter 7.

I have solutions for all but one of the chapter 5 examples that I'd be glad to share if you wanted to compare approaches; I've discovered that there are frequently many ways to solve them.

I'm a newbie also, for me acquiring Purescript is not easy at all. But writing tests has made it easier.

So I'd like it if you took on implementing the tests for chapter 5; you're in a perfect position to do so.. Concurrently I'll implement the tests for chapter 7 as I study it.

Sound like a plan?

from purescript-book.

othelarian avatar othelarian commented on August 28, 2024

I detected multiple issues with the tests of ch12:

  • edge case with the https://reqres.in if the user are behind a http-only proxy
  • On Windows, the countCharacters test ended with Right 42 instead of Right 41, due to "\r\n" git auto conversion
  • On Windows (again), the EOENT: no such file or directory error can go with absolute path in some case, but the assert check on relative path

Do I open a global issue for the three, or one for each?

For people with this issues, here some ways to work around:

  • For the edge case about proxy, install http-server globally (npm i -g http-server), launch with http-server -p 42524 in the test/data dir, and replace the url here (line 142) with http://localhost:42524/user.txt
  • for the Right 41, change 41 to 42
  • for EOENT error, two ideas:
    • reuse what you learn to use Path.resolve to switch to absolute path, and concatenate the path you expected, tricky, but rewarding and interesting as we're here to learn ;-)
    • when you run the test with the solution (ie without any modification of the test/Main.purs file), the failed tests will show the expected returns for each EOENT, copy-paste everywhere it's necessary

from purescript-book.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.