#!/bin/sh

. libtest.sh
. libgit.sh

export COLUMNS=200

# The test checks that pressing ',' in blame view correctly navigates
# to the corresponding line in the target commit.

in_work_dir create_repo_from_tgz "$base_dir/files/scala-js-benchmarks.tgz"

tigrc <<EOF
set line-graphics = ascii
EOF

steps '
	# Press , to go to the parent of the blamed commit for that line
	:parent
	:save-display recursive-blame.screen
'

test_tig blame +36 project/Build.scala

# This shows that after pressing ',' we should be positioned on line 40
# (starting with "clean in common"), as shown in the status bar. We should *not*
# stay on line 36.
assert_equals 'recursive-blame.screen' <<EOF
90286e0 Jonas Fonseca 2013-10-14 14:56 -0400  22|           "-feature",
90286e0 Jonas Fonseca 2013-10-14 14:56 -0400  23|           "-encoding", "utf8"
90286e0 Jonas Fonseca 2013-10-14 14:56 -0400  24|       )
90286e0 Jonas Fonseca 2013-10-14 14:56 -0400  25|   )
90286e0 Jonas Fonseca 2013-10-14 14:56 -0400  26|
90286e0 Jonas Fonseca 2013-10-14 14:56 -0400  27|   lazy val benchmarkSettings = defaultSettings ++ Seq(
90286e0 Jonas Fonseca 2013-10-14 14:56 -0400  28|       unmanagedSources in (Compile, packageJS) +=
90286e0 Jonas Fonseca 2013-10-14 14:56 -0400  29|           baseDirectory.value / "exports.js"
90286e0 Jonas Fonseca 2013-10-14 14:56 -0400  30|   )
90286e0 Jonas Fonseca 2013-10-14 14:56 -0400  31|
90286e0 Jonas Fonseca 2013-10-14 14:56 -0400  32|   lazy val parent: Project = Project(
90286e0 Jonas Fonseca 2013-10-14 14:56 -0400  33|       id = "parent",
90286e0 Jonas Fonseca 2013-10-14 14:56 -0400  34|       base = file("."),
90286e0 Jonas Fonseca 2013-10-14 14:56 -0400  35|       settings = projectSettings ++ Seq(
90286e0 Jonas Fonseca 2013-10-14 14:56 -0400  36|           name := "Scala.js Benchmarks",
90286e0 Jonas Fonseca 2013-10-14 14:56 -0400  37|           publishArtifact in Compile := false,
90286e0 Jonas Fonseca 2013-10-14 14:56 -0400  38|
90286e0 Jonas Fonseca 2013-10-14 14:56 -0400  39|           clean := clean.dependsOn(
90286e0 Jonas Fonseca 2013-10-14 14:56 -0400  40|              clean in common,
4edd069 Jonas Fonseca 2013-10-17 20:34 -0400  41|              clean in richards,
90286e0 Jonas Fonseca 2013-10-14 14:56 -0400  42|              clean in tracer
90286e0 Jonas Fonseca 2013-10-14 14:56 -0400  43|           ).value
90286e0 Jonas Fonseca 2013-10-14 14:56 -0400  44|       )
90286e0 Jonas Fonseca 2013-10-14 14:56 -0400  45|   ).aggregate(
90286e0 Jonas Fonseca 2013-10-14 14:56 -0400  46|       common,
4edd069 Jonas Fonseca 2013-10-17 20:34 -0400  47|       richards,
90286e0 Jonas Fonseca 2013-10-14 14:56 -0400  48|       tracer
90286e0 Jonas Fonseca 2013-10-14 14:56 -0400  49|   )
[blame] 90286e0752016a6bca30dfa7ca236d1f99345eb8 changed project/Build.scala - line 40 of 63                                                                                                         77%
EOF
