Fossil SCM
| dbda8d6… | drh | 1 | # |
| dbda8d6… | drh | 2 | # Copyright (c) 2006 D. Richard Hipp |
| dbda8d6… | drh | 3 | # |
| dbda8d6… | drh | 4 | # This program is free software; you can redistribute it and/or |
| 9d723c5… | drh | 5 | # modify it under the terms of the Simplified BSD License (also |
| 9d723c5… | drh | 6 | # known as the "2-Clause License" or "FreeBSD License".) |
| dbda8d6… | drh | 7 | # |
| dbda8d6… | drh | 8 | # This program is distributed in the hope that it will be useful, |
| 9d723c5… | drh | 9 | # but without any warranty; without even the implied warranty of |
| 9d723c5… | drh | 10 | # merchantability or fitness for a particular purpose. |
| dbda8d6… | drh | 11 | # |
| dbda8d6… | drh | 12 | # Author contact information: |
| dbda8d6… | drh | 13 | # [email protected] |
| dbda8d6… | drh | 14 | # http://www.hwaci.com/drh/ |
| dbda8d6… | drh | 15 | # |
| dbda8d6… | drh | 16 | ############################################################################ |
| dbda8d6… | drh | 17 | # |
| dbda8d6… | drh | 18 | # Tests of the delta mechanism. |
| dbda8d6… | drh | 19 | # |
| dbda8d6… | drh | 20 | |
| fa59221… | mistachkin | 21 | test_setup "" |
| fa59221… | mistachkin | 22 | |
| e5bcfd1… | preben | 23 | set filelist [lsort [glob $testdir/*]] |
| dbda8d6… | drh | 24 | foreach f $filelist { |
| 6502627… | drh | 25 | if {[file isdir $f]} continue |
| dbda8d6… | drh | 26 | set base [file root [file tail $f]] |
| 7e9633a… | jan.nijtmans | 27 | if {[string match "utf16*" $base]} continue |
| dbda8d6… | drh | 28 | set f1 [read_file $f] |
| dbda8d6… | drh | 29 | write_file t1 $f1 |
| dbda8d6… | drh | 30 | for {set i 0} {$i<100} {incr i} { |
| dbda8d6… | drh | 31 | expr {srand($i*2)} |
| dbda8d6… | drh | 32 | write_file t2 [set f2 [random_changes $f1 2 4 0 0.1]] |
| dbda8d6… | drh | 33 | expr {srand($i*2+1)} |
| dbda8d6… | drh | 34 | write_file t3 [set f3 [random_changes $f1 2 4 2 0.1]] |
| dbda8d6… | drh | 35 | expr {srand($i*2+1)} |
| dbda8d6… | drh | 36 | write_file t23 [random_changes $f2 2 4 2 0.1] |
| dbda8d6… | drh | 37 | expr {srand($i*2)} |
| dbda8d6… | drh | 38 | write_file t32 [random_changes $f3 2 4 0 0.1] |
| 8b47f2d… | jan.nijtmans | 39 | fossil 3-way-merge t1 t2 t3 a23 |
| caea288… | drh | 40 | if {[regexp {<<<<< BEGIN MERGE CONFLICT:} [read_file a23]]} continue |
| dbda8d6… | drh | 41 | test merge-$base-$i-23 {[same_file a23 t23]} |
| 8b47f2d… | jan.nijtmans | 42 | fossil 3-way-merge t1 t3 t2 a32 |
| dbda8d6… | drh | 43 | test merge-$base-$i-32 {[same_file a32 t32]} |
| dbda8d6… | drh | 44 | } |
| dbda8d6… | drh | 45 | } |
| fa59221… | mistachkin | 46 | |
| fa59221… | mistachkin | 47 | ############################################################################### |
| fa59221… | mistachkin | 48 | |
| fa59221… | mistachkin | 49 | test_cleanup |