Skip to main content
added 133 characters in body
Source Link
NonlinearFruit
  • 5.8k
  • 12
  • 16
  • Is this problem to bigchallenge too board?
  • ShouldIs this be more constrainedchallenge too big?
  • I've created some basic test runners in a single file before and with some elbow grease, I had trouble thinking of what tag to use.think you could say small (submit-able on CGCC) and add a few nice things
  • Does fit here?
  • RoomIs there room for creativity?
    • The testing syntax and features for the test cases are left up to the implementation
      • How golf-able the test syntax is
      • How the code and test cases interact
      • What asserts/helpers are provided
      • Syntax for skipping test cases
      • Syntax for beforeEach/afterEach
      • Harder features like parameterized tests and fixtures are possible
    • Similarly, the features for the test runner are left pretty open ended
      • TAP output
      • JUnit output
      • Test isolation and parallelization
      • Harder features like specific failure messages and code coverage aren't impossible
  • Is this problem to big?
  • Should this be more constrained?
  • I had trouble thinking of what tag to use. Does fit here?
  • Room for creativity?
    • The testing syntax and features for the test cases are left up to the implementation
      • How golf-able the test syntax is
      • What asserts/helpers are provided
      • Syntax for skipping test cases
      • Syntax for beforeEach/afterEach
      • Harder features like parameterized tests and fixtures are possible
    • Similarly, the features for the test runner are left pretty open ended
      • TAP output
      • JUnit output
      • Test isolation and parallelization
      • Harder features like specific failure messages and code coverage aren't impossible
  • Is this challenge too board?
  • Is this challenge too big?
  • I've created some basic test runners in a single file before and with some elbow grease, I think you could say small (submit-able on CGCC) and add a few nice things
  • Does fit here?
  • Is there room for creativity?
    • The testing syntax and features for the test cases are left up to the implementation
      • How golf-able the test syntax is
      • How the code and test cases interact
      • What asserts/helpers are provided
      • Syntax for skipping test cases
      • Syntax for beforeEach/afterEach
      • Harder features like parameterized tests and fixtures are possible
    • Similarly, the features for the test runner are left pretty open ended
      • TAP output
      • JUnit output
      • Test isolation and parallelization
      • Harder features like specific failure messages and code coverage aren't impossible
added 816 characters in body
Source Link
NonlinearFruit
  • 5.8k
  • 12
  • 16

NOTE: The language used to write the test runner does not necessarily have to be Language X.

The runner should take in:

  • Source codeCode written in languageLanguage X
  • Test cases written in languageLanguage X

The runner should produce:

  • ListAt least a list of test cases. For each test case, include:
    • The test case name
    • A Truthy value if the code executes without errors and no assertions failed
    • A Falsey value if the code errors or an assertion failed
  • Is this problem to big?
  • Should this be more constrained?
  • I had trouble thinking of what tag to use. Does fit here?
  • Room for creativity?
    • The testing syntax and features for the test cases are left up to the implementation
      • How golf-able the test syntax is
      • What asserts/helpers are provided
      • Syntax for skipping test cases
      • Syntax for beforeEach/afterEach
      • Harder features like parameterized tests and fixtures are possible
    • Similarly, the features for the test runner are left pretty open ended
      • TAP output
      • JUnit output
      • Test isolation and parallelization
      • Harder features like specific failure messages and code coverage aren't impossible
  • Source code written in language X
  • Test cases written in language X
  • List of test cases. For each test case, include:
    • The test case name
    • A Truthy value if the code executes without errors and no assertions failed
    • A Falsey value if the code errors or an assertion failed
  • Is this problem to big?
  • Should this be more constrained?
  • I had trouble thinking of what tag to use. Does fit here?

NOTE: The language used to write the test runner does not necessarily have to be Language X.

The runner should take in:

  • Code written in Language X
  • Test cases written in Language X

The runner should produce:

  • At least a list of test cases. For each test case, include:
    • The test case name
    • A Truthy value if the code executes without errors and no assertions failed
    • A Falsey value if the code errors or an assertion failed
  • Is this problem to big?
  • Should this be more constrained?
  • I had trouble thinking of what tag to use. Does fit here?
  • Room for creativity?
    • The testing syntax and features for the test cases are left up to the implementation
      • How golf-able the test syntax is
      • What asserts/helpers are provided
      • Syntax for skipping test cases
      • Syntax for beforeEach/afterEach
      • Harder features like parameterized tests and fixtures are possible
    • Similarly, the features for the test runner are left pretty open ended
      • TAP output
      • JUnit output
      • Test isolation and parallelization
      • Harder features like specific failure messages and code coverage aren't impossible
added 230 characters in body
Source Link
NonlinearFruit
  • 5.8k
  • 12
  • 16

TDG - Test Driven Golf

Our company requires unit testing before code can be deployed to production. Unfortunately, my code is written in esoteric programming languages, none of which have test runners.

Please help me get to production!

InputChallenge

Write a test runner for a programming language (here after called Language X) that takes Language X source code and Language X test cases then outputs the results of running the test cases.

Specification

Input

  • Source code written in language X
  • Test cases written in language X

Output

Output

  • List of test cases. For each test case, include:
    • The test case name
    • A Truthy value if the code executes without errors and no assertions failed
    • A Falsey value if the code errors or an assertion failed

Test Runner

Test Runner

  • The test runner can be written in any language. The only constraint is that the source and test code language be the same
  • Each test runner must at least provide a helper/utility/function to assert that a value is truthy
    • Assert.True(false) => Fails test
    • assertTrue(1 == 3) => Fails test
    • is_truthy 1 => Doesn't fail
    • [[ "a" = "a" ]] => Doesn't fail

Test Cases

Test Cases

  • Each test case must have a name/be name-able
    • it("does stuff", _ => ...) => it does stuff
    • it_does_stuff = _ => ... => it_does_stuff
    • func ItDoesStuff() {...} => ItDoesStuff
  • A code block of language X code

Submissions

Submissions

For consistency, here are some recommendations:

  • Title should be: # Language X runner written in Language Y
    • Where Language X is the source and test code language
    • And Language Y is the language the runner is written in
  • Runner code in a ## Runner section
  • Example input source code in a ## Example Source section
  • Example input test code in a ## Example Tests section
  • Example output in a ## Example Output section

Sandbox Questions

  • Is this problem to big?
  • Should this be more constrained?
  • I had trouble thinking of what tag to use. Does fit here?

TDG - Test Driven Golf

Our company requires unit testing before code can be deployed to production. Unfortunately, my code is written in esoteric programming languages, none of which have test runners.

Please help me get to production!

Input

  • Source code written in language X
  • Test cases written in language X

Output

  • List of test cases. For each test case, include:
    • The test case name
    • A Truthy value if the code executes without errors and no assertions failed
    • A Falsey value if the code errors or an assertion failed

Test Runner

  • The test runner can be written in any language. The only constraint is that the source and test code language be the same
  • Each test runner must at least provide a helper/utility/function to assert that a value is truthy
    • Assert.True(false) => Fails test
    • assertTrue(1 == 3) => Fails test
    • is_truthy 1 => Doesn't fail
    • [[ "a" = "a" ]] => Doesn't fail

Test Cases

  • Each test case must have a name/be name-able
    • it("does stuff", _ => ...) => it does stuff
    • it_does_stuff = _ => ... => it_does_stuff
    • func ItDoesStuff() {...} => ItDoesStuff
  • A code block of language X code

Submissions

For consistency, here are some recommendations:

  • Title should be: # Language X runner written in Language Y
    • Where Language X is the source and test code language
    • And Language Y is the language the runner is written in
  • Runner code in a ## Runner section
  • Example input source code in a ## Example Source section
  • Example input test code in a ## Example Tests section
  • Example output in a ## Example Output section

Sandbox Questions

  • Is this problem to big?
  • Should this be more constrained?
  • I had trouble thinking of what tag to use. Does fit here?

TDG - Test Driven Golf

Our company requires unit testing before code can be deployed to production. Unfortunately, my code is written in esoteric programming languages, none of which have test runners.

Please help me get to production!

Challenge

Write a test runner for a programming language (here after called Language X) that takes Language X source code and Language X test cases then outputs the results of running the test cases.

Specification

Input

  • Source code written in language X
  • Test cases written in language X

Output

  • List of test cases. For each test case, include:
    • The test case name
    • A Truthy value if the code executes without errors and no assertions failed
    • A Falsey value if the code errors or an assertion failed

Test Runner

  • The test runner can be written in any language. The only constraint is that the source and test code language be the same
  • Each test runner must at least provide a helper/utility/function to assert that a value is truthy
    • Assert.True(false) => Fails test
    • assertTrue(1 == 3) => Fails test
    • is_truthy 1 => Doesn't fail
    • [[ "a" = "a" ]] => Doesn't fail

Test Cases

  • Each test case must have a name/be name-able
    • it("does stuff", _ => ...) => it does stuff
    • it_does_stuff = _ => ... => it_does_stuff
    • func ItDoesStuff() {...} => ItDoesStuff
  • A code block of language X code

Submissions

For consistency, here are some recommendations:

  • Title should be: # Language X runner written in Language Y
    • Where Language X is the source and test code language
    • And Language Y is the language the runner is written in
  • Runner code in a ## Runner section
  • Example input source code in a ## Example Source section
  • Example input test code in a ## Example Tests section
  • Example output in a ## Example Output section

Sandbox Questions

  • Is this problem to big?
  • Should this be more constrained?
  • I had trouble thinking of what tag to use. Does fit here?
Source Link
NonlinearFruit
  • 5.8k
  • 12
  • 16
Loading