Add more UseSchema tests.
Rename newly generated file to avoid potentional conflict with tables named table or views named view.
This commit is contained in:
parent
a9aa25416a
commit
5e34bef288
10 changed files with 250 additions and 160 deletions
|
|
@ -253,12 +253,15 @@ func AssertFileContent(t *testing.T, filePath string, expectedContent string) {
|
|||
}
|
||||
|
||||
// AssertFileNamesEqual check if all filesInfos are contained in fileNames
|
||||
func AssertFileNamesEqual(t *testing.T, fileInfos []os.FileInfo, fileNames ...string) {
|
||||
require.Equal(t, len(fileInfos), len(fileNames))
|
||||
func AssertFileNamesEqual(t *testing.T, dirPath string, fileNames ...string) {
|
||||
files, err := ioutil.ReadDir(dirPath)
|
||||
require.NoError(t, err)
|
||||
|
||||
require.Equal(t, len(files), len(fileNames))
|
||||
|
||||
fileNamesMap := map[string]bool{}
|
||||
|
||||
for _, fileInfo := range fileInfos {
|
||||
for _, fileInfo := range files {
|
||||
fileNamesMap[fileInfo.Name()] = true
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue