Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The test file for Hello World is overly confusing and can turn off newcomers #297

Closed
trosel opened this issue Jul 20, 2018 · 4 comments
Closed

Comments

@trosel
Copy link

trosel commented Jul 20, 2018

Compare Python's Hello World test file https://github.com/exercism/python/blob/master/exercises/hello-world/hello_world_test.py

To Perl 6's https://github.com/exercism/perl6/blob/master/exercises/hello-world/hello-world.t

Is there anyway to simplify Perl 6's testing files? Ideally, a test file that a student downloads would teach them how to set up a test. This file is sort of unreadable.

is hello, |.<expected description> for @($c-data<cases>);

In order to test in Perl 6, first you must learn the entire language? Kind of defeats the purpose of Perl allowing for "baby talk" as well as Shakespeare.

@m-dango
Copy link
Member

m-dango commented Jul 21, 2018

PR open @ #298

@trosel
Copy link
Author

trosel commented Jul 21, 2018

What if we shortened the entire thing to:

#!/usr/bin/env perl6
use v6; # This ensures that we're using Perl 6 instead of Perl 5
use Test; # See https://docs.perl6.org/language/testing for more information
use HelloWorld; # Import the HelloWorld.pm6 file. This imports the hello subroutine that we call below
plan 1; # This is how many tests we expect to run

is hello, "Hello, World!"; # checks that the two are equal

@m-dango
Copy link
Member

m-dango commented Jul 21, 2018

The absence of use lib is not ideal as it would require the user to set PERL6LIB themselves.

There is an existing PR to remove versioning @ #228, the reason it was there originally is because if a test file were changed, and someone attempted to run it against an older solution, comments would be made regarding failing tests. When a test is run the version check alerts the user not to expect all tests to succeed due to potential changes. It likely isn't needed anymore but need to make sure that it isn't.

@m-dango
Copy link
Member

m-dango commented Jul 26, 2018

New functionality added to the generator so that canonical data can be ignored in PR #305

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants