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

Add test case for Prime Factors #206

Closed
sunboshan opened this issue Jul 27, 2016 · 2 comments
Closed

Add test case for Prime Factors #206

sunboshan opened this issue Jul 27, 2016 · 2 comments

Comments

@sunboshan
Copy link

Consider add one more test case for Prime Factors

test "10000000055" do
  assert PrimeFactors.factors_for(10000000055) == [5, 2000000011]
end

With my first iteration, it took 44189.1ms to pass this test. So need to tweak the solution to get this test pass in a decent time. I think it would serve a good test case to make your solution more optimized.

@kytrinyx
Copy link
Member

kytrinyx commented Aug 1, 2016

I don't necessarily want to force people to consider optimization as a requirement, but thinking about trade-offs makes the exercise more interesting.

How about making it an optional test (as in "here's something to think about")? Do we have a mechanism for that @exercism/elixir?

@martinsvalin
Copy link
Contributor

I think it'd be fine to simply say so in a code comment by the @tag :pending. Or you could be fancy and configure ExUnit to exclude: [:pending, :extra_credit], and mark the test @tag :extra_credit instead of :pending.

devonestes added a commit to devonestes/xelixir that referenced this issue Aug 4, 2016
This commit adds an additional test case for the `prime-factors` exercise. The
idea was to add in optional performance tests to see if your solution was
quick. I don't quite know what we're going to call "quick" for the purposes of
this test, but since the person who posted the issue said their initial
implementaiton took 44 secinds, I chose 20 seconds as a starting point.

This addresses Issue exercism#206.
devonestes added a commit to devonestes/xelixir that referenced this issue Aug 4, 2016
This commit adds an additional test case for the `prime-factors` exercise. The
idea was to add in optional performance tests to see if your solution was
quick. I don't quite know what we're going to call "quick" for the purposes of
this test, but since the person who posted the issue said their initial
implementaiton took 44 secinds, I chose 20 seconds as a starting point.

This addresses Issue exercism#206.
devonestes added a commit to devonestes/xelixir that referenced this issue Aug 5, 2016
This commit adds an additional test case for the `prime-factors` exercise. The
idea was to add in optional performance tests to see if your solution was
quick. I don't quite know what we're going to call "quick" for the purposes of
this test, but since the person who posted the issue said their initial
implementaiton took 44 secinds, I chose 20 seconds as a starting point.

This addresses Issue exercism#206.
devonestes added a commit to devonestes/xelixir that referenced this issue Aug 5, 2016
This commit adds an additional test case for the `prime-factors` exercise. The
idea was to add in optional performance tests to see if your solution was
quick. I don't quite know what we're going to call "quick" for the purposes of
this test, but since the person who posted the issue said their initial
implementaiton took 44 secinds, I chose 20 seconds as a starting point.

This addresses Issue exercism#206.
devonestes added a commit to devonestes/xelixir that referenced this issue Aug 5, 2016
This commit adds an additional test case for the `prime-factors` exercise. The
idea was to add in optional performance tests to see if your solution was
quick. I don't quite know what we're going to call "quick" for the purposes of
this test, but since the person who posted the issue said their initial
implementaiton took 44 secinds, I chose 20 seconds as a starting point.

This addresses Issue exercism#206.
devonestes added a commit to devonestes/xelixir that referenced this issue Aug 8, 2016
This commit adds an additional test case for the `prime-factors` exercise. The
idea was to add in optional performance tests to see if your solution was
quick. I don't quite know what we're going to call "quick" for the purposes of
this test, but since the person who posted the issue said their initial
implementaiton took 44 secinds, I chose 20 seconds as a starting point.

This addresses Issue exercism#206.
devonestes added a commit to devonestes/xelixir that referenced this issue Aug 10, 2016
This commit adds an additional test case for the `prime-factors` exercise. The
idea was to add in optional performance tests to see if your solution was
quick. I don't quite know what we're going to call "quick" for the purposes of
this test, but since the person who posted the issue said their initial
implementaiton took 44 secinds, I chose 20 seconds as a starting point.

This addresses Issue exercism#206.
devonestes added a commit to devonestes/xelixir that referenced this issue Aug 10, 2016
This commit adds an additional test case for the `prime-factors` exercise. The
idea was to add in optional performance tests to see if your solution was
quick. I don't quite know what we're going to call "quick" for the purposes of
this test, but since the person who posted the issue said their initial
implementaiton took 44 secinds, I chose 20 seconds as a starting point.

This addresses Issue exercism#206.
devonestes added a commit to devonestes/xelixir that referenced this issue Aug 10, 2016
This commit adds an additional test case for the `prime-factors` exercise. The
idea was to add in optional performance tests to see if your solution was
quick. I don't quite know what we're going to call "quick" for the purposes of
this test, but since the person who posted the issue said their initial
implementaiton took 44 secinds, I chose 20 seconds as a starting point.

This addresses Issue exercism#206.
devonestes added a commit to devonestes/xelixir that referenced this issue Aug 10, 2016
This commit adds an additional test case for the `prime-factors` exercise. The
idea was to add in optional performance tests to see if your solution was
quick. I don't quite know what we're going to call "quick" for the purposes of
this test, but since the person who posted the issue said their initial
implementaiton took 44 secinds, I chose 20 seconds as a starting point.

This addresses Issue exercism#206.
@parkerl parkerl closed this as completed Aug 22, 2016
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

4 participants