t / t0205-gettext-poison.shon commit Merge branch 'jc/merge-blobs' into maint (686b895)
   1#!/bin/sh
   2#
   3# Copyright (c) 2010 Ævar Arnfjörð Bjarmason
   4#
   5
   6test_description='Gettext Shell poison'
   7
   8. ./lib-gettext.sh
   9
  10test_expect_success GETTEXT_POISON "sanity: \$GIT_INTERNAL_GETTEXT_SH_SCHEME is set (to $GIT_INTERNAL_GETTEXT_SH_SCHEME)" '
  11    test -n "$GIT_INTERNAL_GETTEXT_SH_SCHEME"
  12'
  13
  14test_expect_success GETTEXT_POISON 'sanity: $GIT_INTERNAL_GETTEXT_SH_SCHEME" is poison' '
  15    test "$GIT_INTERNAL_GETTEXT_SH_SCHEME" = "poison"
  16'
  17
  18test_expect_success GETTEXT_POISON 'gettext: our gettext() fallback has poison semantics' '
  19    printf "# GETTEXT POISON #" >expect &&
  20    gettext "test" >actual &&
  21    test_cmp expect actual &&
  22    printf "# GETTEXT POISON #" >expect &&
  23    gettext "test more words" >actual &&
  24    test_cmp expect actual
  25'
  26
  27test_expect_success GETTEXT_POISON 'eval_gettext: our eval_gettext() fallback has poison semantics' '
  28    printf "# GETTEXT POISON #" >expect &&
  29    eval_gettext "test" >actual &&
  30    test_cmp expect actual &&
  31    printf "# GETTEXT POISON #" >expect &&
  32    eval_gettext "test more words" >actual &&
  33    test_cmp expect actual
  34'
  35
  36test_done