Add unit tests for noiseDetail()
I maintainer di solito rispondono entro 2 giorni
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 75/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- javascript
- Ambito
- testing
Direzione di ricerca
Leggi src/math/noise.js nella zona di noiseDetail() e i test esistenti in test/unit/math/noise.js. Aggiungi test per l'impostazione di octaves e falloff, valori non validi e falloff omesso; ripristina lo stato predefinito successivamente in modo che gli altri test non siano influenzati. Esegui i test unitari di noise e aggiorna il commento obsoleto; completato quando i comportamenti richiesti sono coperti e la suite viene superata.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Increasing access
Tests make noiseDetail()'s behaviour explicit and protect it from regressions, so sketches that rely on it keep working across releases. They also give new contributors a clear reference for how the function is meant to behave.
Most appropriate sub-area of p5.js?
- Accessibility
- Color
- Core/Environment/Rendering
- Data
- DOM
- Events
- Image
- IO
- Math
- Typography
- Utilities
- WebGL
- Build process
- Unit testing
- Internationalization
- Friendly errors
- Other (specify if possible)
Feature enhancement details
noiseDetail() (src/math/noise.js:403-410) has no unit tests. test/unit/math/noise.js:19 notes this:
// ALso need test for noiseSeed and noiseDetail
noiseSeed has since been covered (lines 36-60), but noiseDetail hasn't.
The private getters _getNoiseOctaves() and _getNoiseAmpFalloff() (lines 416-425) make the state directly assertable. Proposed tests:
- sets octaves and falloff when both are given
- ignores
lod <= 0andfalloff <= 0, keeping the previous values - when
falloffis omitted it defaults to 0.5, so a previously set falloff is reset rather than kept
Since the suite shares one mockP5Prototype and noiseDetail state persists in the module closure, the new tests would restore the defaults (4 octaves, 0.5 falloff) afterwards so the existing noise() tests aren't affected.
I'd also update the comment at line 19, since noiseSeed is now tested.
Checked against main at 3193703. The strands noiseDetail tests in the WebGL/WebGPU shader suites cover state leaking between shaders, not this function.
I'd like to fix this myself if approved.
- Lingua principale
- JavaScript
- Stelle
- 24.1k
- Fork
- 3.9k
- Merge medio
- 3g 17h
- PR unite (30g)
- 33
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di processing/p5.js
-
[p5.js 2.0+ Bug Report]: SVG importer does not respect preserveAspectRatio="none" for <symbol>/<use>Forse già presa @Danyccsf l’ha presa 2 giorni fa. ApertaArea:Core p5.js 2.0+
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
processing/p5.js#9257 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
-
[p5.js 2.0+ Bug Report]: storeItem() validation branches are missing `return`, so bad input throws a TypeError or is stored anywayForse già presa @iUjjwalRaj l’ha presa 4 giorni fa. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
processing/p5.js#9242 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
processing/p5.js#9241 ·
I maintainer di solito rispondono entro 2 giorni
-
[p5.js 2.0+ Bug Report]: Typo in Spanish reference documentation for ellipseMode()Forse di nuovo libera @cgutierrezval l’ha presa 7 giorni fa e non c’è nessuna pull request aperta. ApertaInternationalization p5.js 2.0+
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
processing/p5.js#9231 · 3 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
[p5.js 2.0+ Bug Report]: ReferenceError: p5 is not defined when calling loadPixels/get/copy/mask on p5.MediaElement in ESMForse già presa @Pcmhacker-piro l’ha presa 12 giorni fa. ApertaArea:Core Area:DOM
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
processing/p5.js#9189 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di processing/p5.js
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
yjh051108/dsh-routing-suite#216 ·
-
bug user-priority/P2
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 4 giorni
-
bug confirmed perf
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
videojs/video.js#9400 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
agent/scanner bug hive/hosted-available-lke648397-260827-5n31
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno