Skip to content

Commit

Permalink
Add fixture generator and .plist file for GITGraph sort order tests
Browse files Browse the repository at this point in the history
Signed-off-by: Geoff Garside <geoff@geoffgarside.co.uk>
  • Loading branch information
chapados authored and geoffgarside committed Jun 17, 2009
1 parent 9b8861e commit f4c80f2
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 0 deletions.
60 changes: 60 additions & 0 deletions UnitTests/Resources/fixtures/revListFixtures.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>date</key>
<array>
<string>1b06b417010400c92a4d9b840f136315fd83430e</string>
<string>f85a47c40f8de414905e93e907920e8c16f6e572</string>
<string>1dba503f40006d1d89552b4dc8a25dc1a6a4e013</string>
<string>6cbe32dc1cfd3ca776760c8c862006319460e271</string>
<string>12e183104e82db8cc7fd3b17a69aec46fb1d9487</string>
<string>b9237bcb41c35873521545f3e0bbc825ea847d84</string>
<string>06a42c6a5c76120e9adc7d5efd79d9c9eaef936f</string>
<string>c4316dabeac43115f00be867fd22426f54d5040f</string>
<string>34d90f9fea9734ebea38a3349713de9c7ddc9102</string>
<string>a7959d4a69d6771b26c9c2090ccadd35b81d5387</string>
<string>7d68b1f916cfc73c2771bd3282a4f913f767bae2</string>
<string>3135253e5dd7ab4fc53e72bb1192887c3e437574</string>
<string>8c2a16604844b7762fd6545339693cfe822cc75b</string>
<string>f7e7e7d240ccdae143b064aa7467eb2fa91aa8a5</string>
<string>2bb318d2c722b344f6fae8ec274d0c7df9020544</string>
</array>
<key>default</key>
<array>
<string>1b06b417010400c92a4d9b840f136315fd83430e</string>
<string>f85a47c40f8de414905e93e907920e8c16f6e572</string>
<string>1dba503f40006d1d89552b4dc8a25dc1a6a4e013</string>
<string>6cbe32dc1cfd3ca776760c8c862006319460e271</string>
<string>12e183104e82db8cc7fd3b17a69aec46fb1d9487</string>
<string>b9237bcb41c35873521545f3e0bbc825ea847d84</string>
<string>06a42c6a5c76120e9adc7d5efd79d9c9eaef936f</string>
<string>c4316dabeac43115f00be867fd22426f54d5040f</string>
<string>34d90f9fea9734ebea38a3349713de9c7ddc9102</string>
<string>a7959d4a69d6771b26c9c2090ccadd35b81d5387</string>
<string>8c2a16604844b7762fd6545339693cfe822cc75b</string>
<string>7d68b1f916cfc73c2771bd3282a4f913f767bae2</string>
<string>3135253e5dd7ab4fc53e72bb1192887c3e437574</string>
<string>f7e7e7d240ccdae143b064aa7467eb2fa91aa8a5</string>
<string>2bb318d2c722b344f6fae8ec274d0c7df9020544</string>
</array>
<key>topo</key>
<array>
<string>1b06b417010400c92a4d9b840f136315fd83430e</string>
<string>7d68b1f916cfc73c2771bd3282a4f913f767bae2</string>
<string>3135253e5dd7ab4fc53e72bb1192887c3e437574</string>
<string>f85a47c40f8de414905e93e907920e8c16f6e572</string>
<string>1dba503f40006d1d89552b4dc8a25dc1a6a4e013</string>
<string>6cbe32dc1cfd3ca776760c8c862006319460e271</string>
<string>12e183104e82db8cc7fd3b17a69aec46fb1d9487</string>
<string>34d90f9fea9734ebea38a3349713de9c7ddc9102</string>
<string>a7959d4a69d6771b26c9c2090ccadd35b81d5387</string>
<string>b9237bcb41c35873521545f3e0bbc825ea847d84</string>
<string>06a42c6a5c76120e9adc7d5efd79d9c9eaef936f</string>
<string>c4316dabeac43115f00be867fd22426f54d5040f</string>
<string>8c2a16604844b7762fd6545339693cfe822cc75b</string>
<string>f7e7e7d240ccdae143b064aa7467eb2fa91aa8a5</string>
<string>2bb318d2c722b344f6fae8ec274d0c7df9020544</string>
</array>
</dict>
</plist>
32 changes: 32 additions & 0 deletions UnitTests/Resources/fixtures/revlist-fixtures.nu
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env nush
#
# Generate fixture .plist files containing arrays
# of commit-sha1 orders output from git-rev-list commands
#
# copyright 2009, Brian Chapados
#

# Background:
# The revwalk-test branch in the 'dot_git' bare repo contains
# a commit tree that will produce uniquely ordered output for
# the default, --date-order and --topo-order options to git-rev-list
#

(set repoDir "../dot_git")
(set branch "revwalk-test")
(set revList "git-rev-list")

(set optionsMap (dict "default" ""
"date" "--date-order"
"topo" "--topo-order"))

(set commitLists (dict))
(optionsMap each:
(do (name options)
(set output
((NSString stringWithShellCommand:"cd #{repoDir} && #{revList} #{options} #{branch}") chomp))
(commitLists setValue:(/\n/ splitString:output) forKey:name)))

(puts (commitLists description))
;(commitLists writeToFile:"../fixtures/revListFixtures.plist" atomically:YES)
(commitLists writeToFile:"revListFixtures.plist" atomically:YES)

0 comments on commit f4c80f2

Please sign in to comment.