Hyper-optimized Telemetry: Two unit tests are not following specifications in instructions for encoding

Open
#1,795 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
45/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
csharp
Domain
testing

Research direction

Start by locating the Hyper-optimized Telemetry tests named ToBuffer_upper_short and ToBuffer_Zero, then compare their expected encodings with the instruction table for the 0–65535 range. Update the expectations so both values use the specified unsigned-short representation, and run the exercise’s unit tests to confirm they pass.

Written by the indexing model from the issue text.

Description

On the Hyper-optimized Telemetry exercise, the instructions specify a table of ranges and target types for determining which type should be used when converting a long to the smallest integral type. Of particular interest in this issue is the range 0 - 65535 which should be represented with a ushort:

image

However, two unit tests are not following this specification. First one is ToBuffer_upper_short:

image
Since the supplied value 32767 is between 0 and 65353, this should be an unsigned short. Specifically 0x2, 0xff, 0x7f.

The second unit tests not following the instructions is ToBuffer_Zero. It has the exact same problem, expecting 0 to be a signed short, while the instructions specify that it should be unsigned.
image

Dominant language
C#
Stars
428
Forks
384
Avg merge
2d 2h
Merged PRs (30d)
5

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from exercism/csharp

All issues in exercism/csharp

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.