#!/bin/sh

. libtest.sh
. libgit.sh

case "$(uname -s)" in CYGWIN*)
	test_skip "Emojis are not well supported on CYGWIN"
esac

export LINES=10

tigrc <<EOF
set vertical-split = no
EOF

test_setup_work_dir()
{
	git_commit -m "🚑 Fix bug"
	git_commit -m "🐧 Fix Linux issue"
	git_commit -m "✨ Add new feature"
	git_commit -m "🎨 Reformat the code"
	git_commit -m "📚 Document new feature"
	git_commit -m "💄 Polish the UI"
	git_commit -m "🌏💧✋🕋🗡🚀🏜☀🌡🌶💯🚱⏳🌅🌑😡💉😱😈💀💥🌛🌙🐭💥🚶🏻〰🐛⌛👳🙏💥😴🛌😳💥🐛💥👊⚔👑 "
}

git_init

test_case emoji-commit-titles-col-46 \
	--subshell='export COLUMNS=46' \
	<<EOF
2009-04-06 01:44 +0000 Committer o [master] 🌏
2009-03-28 13:22 +0000 Committer o 💄 Polish t
2009-03-20 01:00 +0000 Committer o 📚 Document
2009-03-11 12:38 +0000 Committer o 🎨 Reformat
2009-03-03 00:15 +0000 Committer o ✨ Add new
2009-02-22 11:53 +0000 Committer o 🐧 Fix Linu
2009-02-13 23:31 +0000 Committer I 🚑 Fix bug

[main] 237d747db3f85d2ae36127ecd0371feb4c 100%
EOF

test_case emoji-commit-titles-col-unset \
	--subshell='unset COLUMNS' \
	<<EOF
2009-04-06 01:44 +0000 Committer o [master] 🌏💧✋🕋🗡🚀🏜☀🌡🌶💯🚱⏳🌅🌑😡💉😱😈💀
2009-03-28 13:22 +0000 Committer o 💄 Polish the UI
2009-03-20 01:00 +0000 Committer o 📚 Document new feature
2009-03-11 12:38 +0000 Committer o 🎨 Reformat the code
2009-03-03 00:15 +0000 Committer o ✨ Add new feature
2009-02-22 11:53 +0000 Committer o 🐧 Fix Linux issue
2009-02-13 23:31 +0000 Committer I 🚑 Fix bug

[main] 237d747db3f85d2ae36127ecd0371feb4ca986e3 - commit 1 of 7             100%
EOF

test_case emoji-commit-titles-col-300 \
	--subshell='export COLUMNS=300' \
	<<EOF
2009-04-06 01:44 +0000 Committer o [master] 🌏💧✋🕋🗡🚀🏜☀🌡🌶💯🚱⏳🌅🌑😡💉😱😈💀💥🌛🌙🐭💥🚶🏻〰🐛⌛👳🙏💥😴🛌😳💥🐛💥👊⚔👑
2009-03-28 13:22 +0000 Committer o 💄 Polish the UI
2009-03-20 01:00 +0000 Committer o 📚 Document new feature
2009-03-11 12:38 +0000 Committer o 🎨 Reformat the code
2009-03-03 00:15 +0000 Committer o ✨ Add new feature
2009-02-22 11:53 +0000 Committer o 🐧 Fix Linux issue
2009-02-13 23:31 +0000 Committer I 🚑 Fix bug

[main] 237d747db3f85d2ae36127ecd0371feb4ca986e3 - commit 1 of 7                                                                                                                                                                                                                                         100%
EOF

run_test_cases
