Skip to content

Commit

Permalink
Cases in which Windows behaves different
Browse files Browse the repository at this point in the history
  • Loading branch information
syrmel committed Feb 20, 2024
1 parent 99b6189 commit 11b86b7
Showing 1 changed file with 28 additions and 19 deletions.
47 changes: 28 additions & 19 deletions src/readlink/readlink_test.v
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,24 @@ fn testsuite_begin() {
os.symlink('link_to_c', 'link_to_link_to_c')!
os.symlink('link_to_link_to_c', 'link_to_link_to_link_to_c')!
os.symlink('recursive_link', 'recursive_link')!
os.chdir('c')!
os.symlink('..', 'c_up')!
os.symlink('.', 'c_same')!
os.chdir('..')!

$if !windows {
os.chdir('c')!
os.symlink('..', 'c_up')!
os.symlink('.', 'c_same')!
os.chdir('..')!
}
}

fn testsuite_end() {
os.rm('a')!
os.rm('b')!
os.rm('c/a')!
os.rm('c/b')!
os.rm('c/c_up')!
os.rm('c/c_same')!
$if !windows {
os.rm('c/c_up')!
os.rm('c/c_same')!
}
os.rmdir('c')!
os.rm('link_to_b')!
os.rm('link_to_c')!
Expand All @@ -42,12 +47,14 @@ fn test_compare() {
rig.assert_same_results('')
rig.assert_same_results('.')
rig.assert_same_results('..')
rig.assert_same_results('-fv .')
rig.assert_same_results('-fv ..')
rig.assert_same_results('-ev .')
rig.assert_same_results('-ev ..')
rig.assert_same_results('-mv .')
rig.assert_same_results('-mv ..')
$if !windows {
rig.assert_same_results('-fv .')
rig.assert_same_results('-fv ..')
rig.assert_same_results('-ev .')
rig.assert_same_results('-ev ..')
rig.assert_same_results('-mv .')
rig.assert_same_results('-mv ..')
}
rig.assert_same_results('-mv a')
rig.assert_same_results('-ev a')
rig.assert_same_results('-ev b')
Expand All @@ -58,12 +65,14 @@ fn test_compare() {
rig.assert_same_results('link_to_link_to_c')
rig.assert_same_results('-fv link_to_link_to_c')
rig.assert_same_results('-fv recursive_link')
rig.assert_same_results('-fv link_to_link_to_c/c_same/c_same/c_up/link_to_c/c_up/a')
rig.assert_same_results('-ev link_to_link_to_c/c_same/c_same/c_up/link_to_c/c_up/a')
rig.assert_same_results('-ev link_to_link_to_c/c_same/c_same/c_up/link_to_c/c_up/does_not_exist')
rig.assert_same_results('-mv link_to_link_to_c/c_same/c_same/c_up/link_to_c/c_up/a')
rig.assert_same_results('-mv link_to_link_to_c/c_same/c_same/c_up/link_to_c/c_up/does_not_exist/neither_does_this')
rig.assert_same_results('link_to_link_to_c/c_same/c_same/c_up/link_to_c/c_up/a')
rig.assert_same_results('link_to_link_to_c/c_same/c_same/c_up/link_to_c/c_up/b')
rig.assert_same_results('-v does_not_exist/neither_does_this')
$if !windows {
rig.assert_same_results('-fv link_to_link_to_c/c_same/c_same/c_up/link_to_c/c_up/a')
rig.assert_same_results('-ev link_to_link_to_c/c_same/c_same/c_up/link_to_c/c_up/a')
rig.assert_same_results('-ev link_to_link_to_c/c_same/c_same/c_up/link_to_c/c_up/does_not_exist')
rig.assert_same_results('-mv link_to_link_to_c/c_same/c_same/c_up/link_to_c/c_up/a')
rig.assert_same_results('-mv link_to_link_to_c/c_same/c_same/c_up/link_to_c/c_up/does_not_exist/neither_does_this')
rig.assert_same_results('link_to_link_to_c/c_same/c_same/c_up/link_to_c/c_up/a')
rig.assert_same_results('link_to_link_to_c/c_same/c_same/c_up/link_to_c/c_up/b')
}
}

0 comments on commit 11b86b7

Please sign in to comment.