Skip to content

Commit

Permalink
add failing NuGet test
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander-Block committed Nov 9, 2023
1 parent af61b10 commit 1e37566
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 0 deletions.
60 changes: 60 additions & 0 deletions APLSource/TestCases/Test_NuGet_030.aplf
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
RTest_NuGet_030(stopFlag batchFlag);⎕TRAP;folder;parms;res;log;cals;success;tempDir;config;list
Open a project, add a NuGet dependency where package name and namespace differ, load, call, list, close, re-open, close
⎕TRAP(999 'C' '∘∘∘ ⍝ Deliberate error')(0 'N')
RT._Failed

#.⎕SHADOW'TEMP' 'TEMP'#.⎕NS''
folder∆GetTestPath⎕SI
tempDir∆GetFolderInTempDir⎕SI
tempDir ⎕NCOPY1folder,'/*'

config##.Cider.ReadProjectConfigFile tempDir
config.CIDER.dependencies.nuget'MyNugetPkgs=Utils'
config ##.Cider.WriteProjectConfigFile tempDir

parms##.Cider.CreateOpenParms''
parms.foldertempDir
parms.noPkgLoad0
parms.batch1
parms.ignoreUserExec1

##.Cider.C.YesOrNo_Answers1 2'ChangeCurrentDir@' 'n'
(success log)##.Cider.OpenProject parms
T.GoToTidyUp~success
T.GoToTidyUp/'ERROR'log

list##.Cider.AddNuGetDependencies'Parquet.Net'tempDir
T.GoToTidyUp~('Parquet.Net')∆LazyMatch list

list0 1 ##.Cider.LoadNuGetDependencies tempDir #.TEMP
T.GoToTidyUp~('Parquet.Net')∆LazyMatch list

T.GoToTidyUp~('NetBox')#.TEMP.Utils.⎕NL-9
T.GoToTidyUp~9.6⎕NC '#.TEMP.Utils.Parquet.ParquetException'
T.GoToTidyUp~9.6⎕NC '#.TEMP.Utils.Parquet.ParquetActor'

res##.Cider.ListNuGetDependencies tempDir
T.GoToTidyUp 2res
T.GoToTidyUp~('Parquet.Net')∆LazyMatch res[;1]

res##.Cider.CloseProject tempDir
T.GoToTidyUp res1

#.TEMP.(⎕EX ⎕NL-9)
(success log)##.Cider.OpenProject parms
T.GoToTidyUp~success
T.GoToTidyUp/'ERROR'log
T.GoToTidyUp~('NetBox')#.TEMP.Utils.⎕NL-9
T.GoToTidyUp~9.6⎕NC '#.TEMP.Utils.Parquet.ParquetException'
T.GoToTidyUp~9.6⎕NC '#.TEMP.Utils.Parquet.ParquetActor'

res##.Cider.CloseProject tempDir
T.GoToTidyUp res1

RT._OK

∆TidyUp:
##.Cider.C.Cleanup
res∆LINK'Break' '#.TEMP'
FilesAndDirs.RmDir tempDir,'/..' Does not work: the .NET DLL blocks this; there is no way around this at the time of writing (October 2023)
Done
2 changes: 2 additions & 0 deletions Tests/Test_NuGet_030/APLSource/Hello.aplf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
rHello
r'World'
27 changes: 27 additions & 0 deletions Tests/Test_NuGet_030/cider.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
CIDER: {
dependencies: {
tatin: "",
},
dependencies_dev: {
tatin: "",
},
distributionFolder: "",
init: "",
make: "",
parent: "#",
projectSpace: "TEMP",
project_url: "",
source: "APLSource",
tests: "",
},
LINK: {
watch: "ns",
},
SYSVARS: {
io: 1,
ml: 1,
},
USER: {
},
}

0 comments on commit 1e37566

Please sign in to comment.