2024-08-02 17:29:30 -06:00
|
|
|
# Copyright (c) 2024 DTB <trinity@trinity.moe>
|
|
|
|
# Copyright (c) 2024 Emma Tebibyte <emma@tebibyte.media>
|
|
|
|
# SPDX-License-Identifier: FSFAP
|
|
|
|
#
|
|
|
|
# Copying and distribution of this file, with or without modification, are
|
|
|
|
# permitted in any medium without royalty provided the copyright notice and this
|
|
|
|
# notice are preserved. This file is offered as-is, without any warranty.
|
|
|
|
|
|
|
|
.PHONY: intcmp_tests
|
2024-08-02 18:28:24 -06:00
|
|
|
intcmp_tests: intcmp_help intcmp_e intcmp_g intcmp_l intcmp_combined
|
|
|
|
|
|
|
|
.PHONY: intcmp_help
|
|
|
|
intcmp_help: $(BIN)/intcmp
|
|
|
|
! $(BIN)/intcmp -h
|
2024-08-02 17:29:30 -06:00
|
|
|
|
|
|
|
.PHONY: intcmp_e
|
|
|
|
intcmp_e: $(BIN)/intcmp
|
2024-08-02 18:28:24 -06:00
|
|
|
$(BIN)/intcmp -e 3 3 3 # ==
|
|
|
|
! $(BIN)/intcmp -e 1 2 3 # <
|
|
|
|
! $(BIN)/intcmp -e 3 2 1 # >
|
2024-08-02 17:29:30 -06:00
|
|
|
|
|
|
|
.PHONY: intcmp_g
|
|
|
|
intcmp_g: $(BIN)/intcmp
|
2024-08-02 18:28:24 -06:00
|
|
|
$(BIN)/intcmp -g 3 2 1 # >
|
|
|
|
! $(BIN)/intcmp -g 3 3 3 # ==
|
|
|
|
! $(BIN)/intcmp -g 1 2 3 # <
|
|
|
|
$(BIN)/intcmp -ge 3 3 1 # >=
|
|
|
|
! $(BIN)/intcmp -ge 1 2 3 # <
|
2024-08-02 17:29:30 -06:00
|
|
|
|
|
|
|
.PHONY: intcmp_l
|
|
|
|
intcmp_l: $(BIN)/intcmp
|
2024-08-02 18:28:24 -06:00
|
|
|
$(BIN)/intcmp -l 1 2 3 # <
|
|
|
|
! $(BIN)/intcmp -l 3 3 3 # ==
|
|
|
|
! $(BIN)/intcmp -l 3 2 1 # >
|
|
|
|
$(BIN)/intcmp -le 1 3 3 # <=
|
|
|
|
! $(BIN)/intcmp -le 3 2 1 # >
|
2024-08-02 17:29:30 -06:00
|
|
|
|
|
|
|
.PHONY: intcmp_combined
|
|
|
|
intcmp_combined: $(BIN)/intcmp
|
2024-08-02 18:28:24 -06:00
|
|
|
$(BIN)/intcmp -gl 1 2 3 # <
|
|
|
|
$(BIN)/intcmp -gl 3 2 1 # >
|
|
|
|
$(BIN)/intcmp -gl 1 3 1 # !=
|
|
|
|
! $(BIN)/intcmp -gl 3 3 3 # ==
|
|
|
|
$(BIN)/intcmp -egl 3 1 1 3 # >, ==, <
|
|
|
|
! $(BIN)/intcmp -egl foo # huh?
|