Files
RedBear-OS/local/recipes/tools/diffutils/source/tests/diff3
T
vasilito 068a1ca63e bootloader: rebase onto upstream 1.0.0, sync firmware-loader version
Bootloader fork rebase:
- Base changed from 0.1.0 pre-patched archive to upstream 1.0.0 tag (c7eeb9f)
- Applied 0001-redbear-local-forks.patch (Cargo.toml crate path redirects)
- Applied fix-uefi-alloc-panic.patch equivalents (4 panic!() -> graceful
  error handling in src/main.rs)
- Applied P5-live-preload-cap-1gib.patch (1 GiB cap on live image preload)
- Skipped: P0 GPT partition scan (requires new module + integration),
  P1 timeout/default-resolution, P2 live preload guard (subsumed by
  panic fixes + cap), P3 live image safe read, P4 large ISO boot,
  redox.patch — to be applied in dedicated rebase session.

firmware-loader/Cargo.toml: version 0.1.0 -> 0.3.0 (sync with other
Red Bear custom crates which are at 0.3.0).

fork-upstream-map.toml: bootloader back from PENDING_REBASE to 1.0.0
since the partial rebase matches upstream 1.0.0 content.

fork-upstream-map.toml: base restored to 'main' tracked (was correctly
tracked by build-redbear.sh).
2026-07-11 09:47:59 +03:00

99 lines
1.4 KiB
Bash

#!/bin/sh
# This would malfunction in diff-3.4
. "${srcdir=.}/init.sh"; path_prepend_ ../src
echo a > a || framework_failure_
echo b > b || framework_failure_
echo c > c || framework_failure_
cat <<'EOF' > exp || framework_failure_
====
1:1c
a
2:1c
b
3:1c
c
EOF
fail=0
# Use --diff-program=diff since --program-transform-name and similar are
# applied after 'make install'.
diff3 --diff-program=diff a b c > out 2> err || fail=1
compare exp out || fail=1
compare /dev/null err || fail=1
# Repeat, but with all three files the same:
diff3 --diff-program=diff a a a > out 2> err || fail=1
compare /dev/null out || fail=1
compare /dev/null err || fail=1
# This would have provoked a nontrivial leak prior to diffutils-3.5,
# due to the nontrivial list of diff_block structs.
seq 10 40|sed 's/1$/x/' > d || framework_failure_
seq 10 40|sed 's/5$/y/' > e || framework_failure_
seq 10 40|sed 's/8$/z/' > f || framework_failure_
cat <<'EOF' > exp40 || framework_failure_
====1
1:2c
1x
2:2c
3:2c
11
====2
1:6c
3:6c
15
2:6c
1y
====3
1:9c
2:9c
18
3:9c
1z
====1
1:12c
2x
2:12c
3:12c
21
====2
1:16c
3:16c
25
2:16c
2y
====3
1:19c
2:19c
28
3:19c
2z
====1
1:22c
3x
2:22c
3:22c
31
====2
1:26c
3:26c
35
2:26c
3y
====3
1:29c
2:29c
38
3:29c
3z
EOF
diff3 --diff-program=diff d e f > out 2> err
compare exp40 out || fail=1
compare /dev/null err || fail=1
Exit $fail