-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmerge2.test
41 lines (40 loc) · 1.28 KB
/
merge2.test
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#
# Copyright (c) 2006 D. Richard Hipp
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the Simplified BSD License (also
# known as the "2-Clause License" or "FreeBSD License".)
#
# This program is distributed in the hope that it will be useful,
# but without any warranty; without even the implied warranty of
# merchantability or fitness for a particular purpose.
#
# Author contact information:
# drh@hwaci.com
# http://www.hwaci.com/drh/
#
############################################################################
#
# Tests of the delta mechanism.
#
set filelist [glob $testdir/*]
foreach f $filelist {
if {[file isdir $f]} continue
set base [file root [file tail $f]]
set f1 [read_file $f]
write_file t1 $f1
for {set i 0} {$i<100} {incr i} {
expr {srand($i*2)}
write_file t2 [set f2 [random_changes $f1 2 4 0 0.1]]
expr {srand($i*2+1)}
write_file t3 [set f3 [random_changes $f1 2 4 2 0.1]]
expr {srand($i*2+1)}
write_file t23 [random_changes $f2 2 4 2 0.1]
expr {srand($i*2)}
write_file t32 [random_changes $f3 2 4 0 0.1]
fossil test-3-way-merge t1 t2 t3 a23
test merge-$base-$i-23 {[same_file a23 t23]}
fossil test-3-way-merge t1 t3 t2 a32
test merge-$base-$i-32 {[same_file a32 t32]}
}
}