1// ============================================================================ 2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab 3// Copyright (C) 2011 - DIGITEO - Bruno JOFRET 4// 5// This file is distributed under the same license as the Scilab package. 6// ============================================================================ 7 8// <-- CLI SHELL MODE --> 9 10// ============================================================================ 11// Unitary tests for getdrives function 12// ============================================================================ 13 14ierr = execstr("getdrives(0)", "errcatch"); 15if ierr <> 77 then pause,end 16 17drives = getdrives(); 18 19if getos() == "Windows" then 20 // 21 // Windows part 22 // 23 // At least one letter 24 if size(drives, '*') < 1 then pause,end 25 for i=drives 26 if isdir(i) == %f then pause,end 27 end 28else 29 // 30 // Linux and Mac 31 // 32 if size(drives, '*') <> 1 then pause,end 33 if drives <> "/" then pause,end 34 if isdir(drives) == %f then pause,end 35end