Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: git/git
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: b9849e4f7631d80f146d159bf7b60263b3205632
Choose a base ref
...
head repository: git/git
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 9ddec6b79af6786bc628e66a75f47040fea1857b
Choose a head ref
  • 6 commits
  • 8 files changed
  • 1 contributor

Commits on Jul 30, 2024

  1. t0080: use here-doc test body

    Improve the readability of the expected output by using a here-doc for
    the test body and replacing the unwieldy ${SQ} references with literal
    single quotes.
    
    Signed-off-by: René Scharfe <l.s.r@web.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    rscharfe authored and gitster committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    4575ba6 View commit details
    Browse the repository at this point in the history
  2. unit-tests: show location of checks outside of tests

    Checks outside of tests are caught at runtime and reported like this:
    
     Assertion failed: (ctx.running), function test_assert, file test-lib.c, line 267.
    
    The assert() call aborts the unit test and doesn't reveal the location
    or even the type of the offending check, as test_assert() is called by
    all of them.
    
    Handle it like the opposite case, a test without any checks: Don't
    abort, but report the location of the actual check, along with a message
    explaining the situation.  The output for example above becomes:
    
     # BUG: check outside of test at t/helper/test-example-tap.c:75
    
    ... and the unit test program continues and indicates the error in its
    exit code at the end.
    
    Signed-off-by: René Scharfe <l.s.r@web.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    rscharfe authored and gitster committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    1f452d6 View commit details
    Browse the repository at this point in the history
  3. unit-tests: add if_test

    The macro TEST only allows defining a test that consists of a single
    expression.  Add a new macro, if_test, which provides a way to define
    unit tests that are made up of one or more statements.
    
    if_test allows defining self-contained tests en bloc, a bit like
    test_expect_success does for regular tests.  It acts like a conditional;
    the test body is executed if test_skip_all() had not been called before.
    
    Signed-off-by: René Scharfe <l.s.r@web.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    rscharfe authored and gitster committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    96c6304 View commit details
    Browse the repository at this point in the history
  4. t-ctype: use if_test

    Use the documented macro if_test instead of the internal functions
    test__run_begin() and test__run_end(), which are supposed to be private
    to the unit test framework.
    
    Signed-off-by: René Scharfe <l.s.r@web.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    rscharfe authored and gitster committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    e51d7ef View commit details
    Browse the repository at this point in the history
  5. t-reftable-basics: use if_test

    The macro TEST takes a single expression.  If a test requires multiple
    statements then they need to be placed in a function that's called in
    the TEST expression.
    
    Remove the overhead of defining and calling single-use functions by
    using if_test instead.
    
    Run the tests in the order of definition.  We can reorder them like that
    because they are independent.  Technically this changes the output, but
    retains the meaning of a full run and allows for easier review e.g. with
    diff option --ignore-all-space.
    
    Signed-off-by: René Scharfe <l.s.r@web.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    rscharfe authored and gitster committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    2c4a6a8 View commit details
    Browse the repository at this point in the history
  6. t-strvec: use if_test

    The macro TEST takes a single expression.  If a test requires multiple
    statements then they need to be placed in a function that's called in
    the TEST expression.
    
    Remove the cognitive overhead of defining and calling single-use
    functions by using if_test instead.
    
    Signed-off-by: René Scharfe <l.s.r@web.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    rscharfe authored and gitster committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    9ddec6b View commit details
    Browse the repository at this point in the history
Loading