#!/bin/sh

. libtest.sh
. libgit.sh

export LINES=16

tigrc <<EOF
set vertical-split = no
set tree-view-date-use-author = yes
EOF

steps '
	:view-tree
	:save-display tree-default.screen

	:toggle sort-field
	:save-display tree-default-mode.screen

	:toggle sort-field
	:save-display tree-default-author.screen

	:toggle sort-field

	:toggle sort-field
	:save-display tree-default-file-size.screen

	:toggle sort-field
	:save-display tree-default-date.screen

	:toggle sort-field
	:enter
	:save-display tree-common.screen

	:/d8-stubs
	:enter
	:save-display tree-d8-stubs.screen
'

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

test_tig

assert_equals 'tree-default.screen' <<EOF
Directory path /
drwxr-xr-x Jonas Fonseca       2014-03-01 17:26 -0500 common
drwxr-xr-x Jonas Fonseca       2014-03-01 17:26 -0500 deltablue
drwxr-xr-x Jonas Fonseca       2014-03-01 17:26 -0500 project
drwxr-xr-x Jonas Fonseca       2014-03-01 17:26 -0500 richards
drwxr-xr-x Jonas Fonseca       2014-03-01 17:26 -0500 sudoku
drwxr-xr-x Jonas Fonseca       2014-03-01 17:26 -0500 tracer
-rw-r--r-- Jonas Fonseca    53 2013-10-14 16:19 -0400 .gitignore
-rw-r--r-- Jonas Fonseca  1499 2013-10-26 12:54 -0400 LICENSE
-rw-r--r-- Philipp Haller 2609 2014-01-16 15:32 +0100 README.md
-rwxr-xr-x Jonas Fonseca   493 2014-03-01 17:26 -0500 run.sh
 
 
 
[tree] 1a4ced7066ada2b26dcb0044f763a8438cd375df - file 1 of 10              100%
EOF

assert_equals 'tree-default-author.screen' <<EOF
Directory path /
-rw-r--r-- Jonas Fonseca    53 2013-10-14 16:19 -0400 .gitignore
-rw-r--r-- Jonas Fonseca  1499 2013-10-26 12:54 -0400 LICENSE
drwxr-xr-x Jonas Fonseca       2014-03-01 17:26 -0500 common
drwxr-xr-x Jonas Fonseca       2014-03-01 17:26 -0500 deltablue
drwxr-xr-x Jonas Fonseca       2014-03-01 17:26 -0500 project
drwxr-xr-x Jonas Fonseca       2014-03-01 17:26 -0500 richards
-rwxr-xr-x Jonas Fonseca   493 2014-03-01 17:26 -0500 run.sh
drwxr-xr-x Jonas Fonseca       2014-03-01 17:26 -0500 sudoku
drwxr-xr-x Jonas Fonseca       2014-03-01 17:26 -0500 tracer
-rw-r--r-- Philipp Haller 2609 2014-01-16 15:32 +0100 README.md
 
 
 
[tree] be06d7d413c0b3f2d2f6f18061c8bfb65c510b64 - file 7 of 10              100%
EOF

assert_equals 'tree-default-date.screen' <<EOF
Directory path /
-rw-r--r-- Jonas Fonseca    53 2013-10-14 16:19 -0400 .gitignore
-rw-r--r-- Jonas Fonseca  1499 2013-10-26 12:54 -0400 LICENSE
-rw-r--r-- Philipp Haller 2609 2014-01-16 15:32 +0100 README.md
drwxr-xr-x Jonas Fonseca       2014-03-01 17:26 -0500 common
drwxr-xr-x Jonas Fonseca       2014-03-01 17:26 -0500 deltablue
drwxr-xr-x Jonas Fonseca       2014-03-01 17:26 -0500 project
drwxr-xr-x Jonas Fonseca       2014-03-01 17:26 -0500 richards
-rwxr-xr-x Jonas Fonseca   493 2014-03-01 17:26 -0500 run.sh
drwxr-xr-x Jonas Fonseca       2014-03-01 17:26 -0500 sudoku
drwxr-xr-x Jonas Fonseca       2014-03-01 17:26 -0500 tracer
 
 
 
[tree] be06d7d413c0b3f2d2f6f18061c8bfb65c510b64 - file 7 of 10              100%
EOF

assert_equals 'tree-default-file-size.screen' <<EOF
Directory path /
-rw-r--r-- Jonas Fonseca    53 2013-10-14 16:19 -0400 .gitignore
-rwxr-xr-x Jonas Fonseca   493 2014-03-01 17:26 -0500 run.sh
-rw-r--r-- Jonas Fonseca  1499 2013-10-26 12:54 -0400 LICENSE
-rw-r--r-- Philipp Haller 2609 2014-01-16 15:32 +0100 README.md
drwxr-xr-x Jonas Fonseca       2014-03-01 17:26 -0500 common
drwxr-xr-x Jonas Fonseca       2014-03-01 17:26 -0500 deltablue
drwxr-xr-x Jonas Fonseca       2014-03-01 17:26 -0500 project
drwxr-xr-x Jonas Fonseca       2014-03-01 17:26 -0500 richards
drwxr-xr-x Jonas Fonseca       2014-03-01 17:26 -0500 sudoku
drwxr-xr-x Jonas Fonseca       2014-03-01 17:26 -0500 tracer
 
 
 
[tree] be06d7d413c0b3f2d2f6f18061c8bfb65c510b64 - file 7 of 10              100%
EOF

assert_equals 'tree-default-mode.screen' <<EOF
Directory path /
drwxr-xr-x Jonas Fonseca       2014-03-01 17:26 -0500 common
drwxr-xr-x Jonas Fonseca       2014-03-01 17:26 -0500 deltablue
drwxr-xr-x Jonas Fonseca       2014-03-01 17:26 -0500 project
drwxr-xr-x Jonas Fonseca       2014-03-01 17:26 -0500 richards
drwxr-xr-x Jonas Fonseca       2014-03-01 17:26 -0500 sudoku
drwxr-xr-x Jonas Fonseca       2014-03-01 17:26 -0500 tracer
-rw-r--r-- Jonas Fonseca    53 2013-10-14 16:19 -0400 .gitignore
-rw-r--r-- Jonas Fonseca  1499 2013-10-26 12:54 -0400 LICENSE
-rw-r--r-- Philipp Haller 2609 2014-01-16 15:32 +0100 README.md
-rwxr-xr-x Jonas Fonseca   493 2014-03-01 17:26 -0500 run.sh
 
 
 
[tree] 1a4ced7066ada2b26dcb0044f763a8438cd375df - file 1 of 10              100%
EOF

assert_equals 'tree-common.screen' <<EOF
Directory path /common/
drwxr-xr-x                                           ..
drwxr-xr-x Jonas Fonseca      2014-01-16 17:39 -0500 reference
drwxr-xr-x Jonas Fonseca      2014-03-01 17:26 -0500 src
-rwxr-xr-x Jonas Fonseca 2875 2014-03-01 17:26 -0500 benchmark-runner.sh
-rw-r--r-- Jonas Fonseca    0 2013-10-14 13:15 -0400 build.sbt
-rw-r--r-- Jonas Fonseca  702 2013-10-26 12:54 -0400 d8-stubs.js
-rw-r--r-- Jonas Fonseca  811 2014-03-01 17:26 -0500 start-benchmark.js
 
 
 
 
 
 
[tree] Open parent directory                                                100%
EOF

assert_equals 'tree-d8-stubs.screen' <<EOF
drwxr-xr-x Jonas Fonseca      2014-03-01 17:26 -0500 src
-rwxr-xr-x Jonas Fonseca 2875 2014-03-01 17:26 -0500 benchmark-runner.sh
-rw-r--r-- Jonas Fonseca    0 2013-10-14 13:15 -0400 build.sbt
-rw-r--r-- Jonas Fonseca  702 2013-10-26 12:54 -0400 d8-stubs.js
[tree] f05286bfd477c28503b946e93925b3d32ce4178d - file 5 of 6                87%
/*                     __                                               *\\
**     ________ ___   / /  ___      __ ____  Scala.js Benchmarks        **
**    / __/ __// _ | / /  / _ | __ / // __/  (c) 2013, Jonas Fonseca    **
**  __\ \/ /__/ __ |/ /__/ __ |/_// /_\ \                               **
** /____/\___/_/ |_/____/_/ | |__/ /____/                               **
**                          |/____/                                     **
\*                                                                      */
 
/*
[blob] common/d8-stubs.js - line 1 of 16                                     56%
EOF
