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

Create testing code for the Nock and Noun module #87

Merged
merged 22 commits into from
Dec 19, 2023
Merged

Conversation

mariari
Copy link
Member

@mariari mariari commented Dec 19, 2023

We test:

  1. Nock
  2. Noun
  3. Noun.Format

further we write some custom hoon functions that compile to nock using our standard library, making sure that nock evaluation works as expected.

The Noun tests mainly test inserting and indexing

mariari and others added 21 commits November 10, 2023 17:59
It seems to be already set to 98 according to the elixir forums:

https://elixirforum.com/t/why-does-the-elixir-formatter-default-to-98-characters/45063

however it is good to set it, so that we may tweak it in the future if
need be
Moving it to 78, makes sure the line does not exceed 80 characters
long.

Included in this commit is the result of `mix format`, which shows how
this change affects the codebase
Nock is a universal function on the noun data structure (atomic
nonnegative integers, and cons cells of nouns). We include a naive
implementation of the spec here.
The hint noun is an arbitrary noun, even if this is where names go in
real hints.
Some of these lack the context of the Nock spec sub-operators, but on
the whole it's a useful quick reference.
The hint is put into a cell with the real result before it is
discarded. I don't want to deviate from the literal spec in naive_nock.
Having gone back and forth on whether this or all conses explicit is
more readable, I tentatively think this, despite its asymmetry, is
mostly better. Nock 6 uses an as-pattern, and is less improved.
By default Dialyzer does not accept improper lists to pass the
dialyzer test. However we may want to use them for Nock code, so we
shall disable them until further notice
…ag' and 'anoma/mariari/set-project-line-length' into 'ray/nock-jets'
Very simple - arithmetic, with jet hints.
note: does not pass to recursive calls; those are still jetted!

use dec of a huge number to test that jetting works at all.
this will be replaced with a jet-testing mode in the final branch
@mariari mariari requested a review from juped December 19, 2023 15:36
@mariari mariari force-pushed the mariari/testing-nock branch from c046809 to 64f1f9e Compare December 19, 2023 15:36
@juped juped changed the base branch from next to base December 19, 2023 16:32
We test:
1. Nock
2. Noun
3. Noun.Format

further we write some custom hoon functions that compile to nock using
our standard library, making sure that nock evaluation works as
expected.

The Noun tests mainly test inserting and indexing
@juped juped force-pushed the mariari/testing-nock branch from 64f1f9e to 6c77aae Compare December 19, 2023 16:47
@juped juped merged commit 985ad9b into base Dec 19, 2023
2 checks passed
@mariari mariari deleted the mariari/testing-nock branch July 20, 2024 03:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants