code: def test_truncate():
      """Test truncate function"""
      assert truncate("1234567890", 50) == "1234567890"
      assert truncate("1234567890", 5) == "1234…"
      assert truncate("1234567890", 1) == "…"
      assert truncate("1234567890", 9) == "12345678…"
      assert truncate("1234567890", 10) == "1234567890"
      assert truncate("1234567890", 0) == "1234567890"
      assert truncate("1234567890", -1) == "1234567890"
  
file_path: pygal/pygal/test/test_util.py
imports: from pytest import raises
  from pygal.util import _swap_curly, majorize, mergextend, minify_css, round_to_float, round_to_int, template, truncate
label_desc: Use image node_id 5 for calling a global function with example usage: test_truncate() without return types