JuliaDiff / JuliaDiff/ChainRulesTestUtils.jl

check_equal for DoesNotExist

Open
#109 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

good first issue
Dominant language
Julia
Stars
50
Forks
18
PR merge metrics
No merged PRs in 30d

Description

We have check_equal for Zero() but not for DoesNotExist(), which currently breaks

julia> check_equal(2.0, DoesNotExist())
ERROR: MethodError: no method matching length(::DoesNotExist)
...

julia> check_equal(Zero(), DoesNotExist())
ERROR: StackOverflowError:
...

We should probably have DoesNotExist() be equal to itself, and nothing else

check_equal(::DoesNotExist, x; kwargs...) = @test false
check_equal(x, ::DoesNotExist; kwargs...) = @test false
check_equal(x::DoesNotExist, y::DoesNotExist; kwargs...) = @test true

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.

Research direction

Start at the check_equal entry point and compare its existing handling of Zero() with the reported DoesNotExist() cases. Reproduce the two examples, then verify that comparisons involving DoesNotExist() behave as described and that the existing check_equal behavior remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
testing-qa
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.