mirror of
https://github.com/sbrow/thor.git
synced 2026-10-25 10:11:55 -04:00
refactor: Renamed DIAGNOSTIC_TODOS.yaml to DIAGNOSTIC_TESTS.yaml.
This commit is contained in:
@@ -28,11 +28,11 @@ Remember to polish existing features before moving on to new ones.
|
|||||||
- [ ] write test for error when n == 0
|
- [ ] write test for error when n == 0
|
||||||
- [x] warn when using negative numbers
|
- [x] warn when using negative numbers
|
||||||
- [x] warn when using default arg on string
|
- [x] warn when using default arg on string
|
||||||
- [x] add the above warnings to DIAGNOSTIC_TODOS.md
|
- [x] add the above warnings to DIAGNOSTIC_TESTS.md
|
||||||
- [ ] Instead of "clearer form", be exact: "last 5"
|
- [ ] Instead of "clearer form", be exact: "last 5"
|
||||||
- [ ] write tests for `first 0` & `last 0`
|
- [ ] write tests for `first 0` & `last 0`
|
||||||
- [ ] update tests to assert diagnostics when appropriate
|
- [ ] update tests to assert diagnostics when appropriate
|
||||||
- do we want to do this or just use DIAGNOSTIC_TODOS.md as the tests?
|
- do we want to do this or just use DIAGNOSTIC_TESTS.md as the tests?
|
||||||
- [ ] also update to use file logger so they don't clog up the output
|
- [ ] also update to use file logger so they don't clog up the output
|
||||||
- [ ] narrow highlight in diagnostic to relevent part of line.
|
- [ ] narrow highlight in diagnostic to relevent part of line.
|
||||||
|
|
||||||
@@ -58,11 +58,11 @@ All diagnostics (errors) should show
|
|||||||
|
|
||||||
- [ ] try to make file paths clickable links.
|
- [ ] try to make file paths clickable links.
|
||||||
- [ ] make sure the frontmatter parser has good diagnostics.
|
- [ ] make sure the frontmatter parser has good diagnostics.
|
||||||
- [ ] add all known diagnostics to [DIAGNOSTIC TODOS](./DIAGNOSTIC_TODOS.yaml).
|
- [ ] add all known diagnostics to [DIAGNOSTIC TODOS](./DIAGNOSTIC_TESTS.yaml).
|
||||||
- [ ] fix the broken diagnostics in [DIAGNOSTIC TODOS](./DIAGNOSTIC_TODOS.yaml)
|
- [ ] fix the broken diagnostics in [DIAGNOSTIC TODOS](./DIAGNOSTIC_TESTS.yaml)
|
||||||
- [ ] show *stack trace* for template partials?
|
- [ ] show *stack trace* for template partials?
|
||||||
- [ ] show where the typo occurred (config file path for `apply_extension_config`, full `-ext:value` for `parse_extension_list`)
|
- [ ] show where the typo occurred (config file path for `apply_extension_config`, full `-ext:value` for `parse_extension_list`)
|
||||||
- [ ] **all** diagnostics in [DIAGNOSTIC TODOS](./DIAGNOSTIC_TODOS.yaml) must be tested.
|
- [ ] **all** diagnostics in [DIAGNOSTIC TODOS](./DIAGNOSTIC_TESTS.yaml) must be tested.
|
||||||
- [ ] only report format errors once.
|
- [ ] only report format errors once.
|
||||||
- [ ] only report missing partial errors once.
|
- [ ] only report missing partial errors once.
|
||||||
- [ ] better diagnostics for syntax errors in treesitter.
|
- [ ] better diagnostics for syntax errors in treesitter.
|
||||||
|
|||||||
@@ -480,10 +480,10 @@ test_parse_error_pipe_parse_in_inverted_keeps_double_braces :: proc(t: ^testing.
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// Data-driven diagnostic cases (from DIAGNOSTIC_TODOS.yaml)
|
// Data-driven diagnostic cases (from DIAGNOSTIC_TESTS.yaml)
|
||||||
//
|
//
|
||||||
// write_diagnostic_tests generates diagnostic_test_cases_test.odin from the
|
// write_diagnostic_tests generates diagnostic_test_cases_test.odin from the
|
||||||
// enabled cases in DIAGNOSTIC_TODOS.yaml. On the first run (or when the YAML
|
// enabled cases in DIAGNOSTIC_TESTS.yaml. On the first run (or when the YAML
|
||||||
// changes), it regenerates the file and fails. On the second run, each case
|
// changes), it regenerates the file and fails. On the second run, each case
|
||||||
// runs as an individual test via run_diag_case.
|
// runs as an individual test via run_diag_case.
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
@@ -541,7 +541,7 @@ diag_slug :: proc(name: string) -> string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
run_diag_case :: proc(t: ^testing.T, name: string) {
|
run_diag_case :: proc(t: ^testing.T, name: string) {
|
||||||
cases := load_diag_cases("../DIAGNOSTIC_TODOS.yaml")
|
cases := load_diag_cases("../DIAGNOSTIC_TESTS.yaml")
|
||||||
ctx := diag_ctx()
|
ctx := diag_ctx()
|
||||||
partials := diag_partials()
|
partials := diag_partials()
|
||||||
|
|
||||||
@@ -661,12 +661,12 @@ run_diag_case :: proc(t: ^testing.T, name: string) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
testing.expectf(t, false, "case '%s' not found in DIAGNOSTIC_TODOS.yaml", name)
|
testing.expectf(t, false, "case '%s' not found in DIAGNOSTIC_TESTS.yaml", name)
|
||||||
}
|
}
|
||||||
|
|
||||||
@(test)
|
@(test)
|
||||||
write_diagnostic_tests :: proc(t: ^testing.T) {
|
write_diagnostic_tests :: proc(t: ^testing.T) {
|
||||||
cases := load_diag_cases("../DIAGNOSTIC_TODOS.yaml")
|
cases := load_diag_cases("../DIAGNOSTIC_TESTS.yaml")
|
||||||
testing.expect(t, len(cases) > 0, "should load diagnostic cases")
|
testing.expect(t, len(cases) > 0, "should load diagnostic cases")
|
||||||
|
|
||||||
sb: strings.Builder
|
sb: strings.Builder
|
||||||
|
|||||||
Reference in New Issue
Block a user