From 142b718d9bce0be499e8426c27bce848728559a8 Mon Sep 17 00:00:00 2001 From: Mattia Rizzolo Date: Fri, 13 Nov 2015 11:21:45 +0000 Subject: modules: add 3 log.{i,w,e} functions to be used instead of log() --- pbuilder-modules | 12 ++++++++++++ t/test_pbuilder-modules | 9 +++++++++ 2 files changed, 21 insertions(+) diff --git a/pbuilder-modules b/pbuilder-modules index 363f7d7..806f6f0 100644 --- a/pbuilder-modules +++ b/pbuilder-modules @@ -116,6 +116,18 @@ function log() { esac } +log.e() { + log "E: $*" +} + +log.w() { + log "W: $*" +} + +log.i() { + log "I: $*" +} + # test whether a directory is empty # fails if "$*" exists but isn't a directory # fails and outputs garbage if "$*" doesn't actually exist diff --git a/t/test_pbuilder-modules b/t/test_pbuilder-modules index 9e1f6e0..52a38ac 100755 --- a/t/test_pbuilder-modules +++ b/t/test_pbuilder-modules @@ -18,6 +18,15 @@ expect_output "I: test W: warning E: error" test_information +function test_log() { + log.i "info" + log.w "warn" + log.e "error" +} +expect_output "I: info +W: warn +E: error" test_log + # test the non-copy case function test_conditional_cp_a() { ( -- cgit v1.2.3