Skip to content

Commit 582422e

Browse files
fingolfincodex
andauthored
Use plain boolean checks instead of Assert in tests (#69)
Co-authored-by: Codex <codex@openai.com>
1 parent 98620c3 commit 582422e

2 files changed

Lines changed: 25 additions & 25 deletions

File tree

tst/git.tst

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ gap> tmpdir := Filename( DirectoryTemporary(), "packagemaker-git-tst" );;
55
gap> if IsDirectoryPath( tmpdir ) then RemoveDirectoryRecursively( tmpdir ); fi;
66
gap> AUTODOC_CreateDirIfMissing( tmpdir );
77
true
8-
gap> Assert( 0,
9-
> PKGMKR_CommandOutput( Directory( tmpdir ), "git", [ "init", "-b", "main" ] ) <> fail );;
10-
gap> Assert( 0,
11-
> PKGMKR_CommandOutput( Directory( tmpdir ), "git",
12-
> [ "config", "user.name", "PackageMaker Tests" ] ) <> fail );;
13-
gap> Assert( 0,
14-
> PKGMKR_CommandOutput( Directory( tmpdir ), "git",
15-
> [ "config", "user.email", "tests@example.invalid" ] ) <> fail );;
8+
gap> PKGMKR_CommandOutput( Directory( tmpdir ), "git", [ "init", "-b", "main" ] ) <> fail;
9+
true
10+
gap> PKGMKR_CommandOutput( Directory( tmpdir ), "git",
11+
> [ "config", "user.name", "PackageMaker Tests" ] ) <> fail;
12+
true
13+
gap> PKGMKR_CommandOutput( Directory( tmpdir ), "git",
14+
> [ "config", "user.email", "tests@example.invalid" ] ) <> fail;
15+
true
1616
gap> PrintTo( Filename( Directory( tmpdir ), "README.md" ), "probe\n" );;
1717
gap> CreateGitRepository(
1818
> Directory( tmpdir ),
@@ -68,14 +68,14 @@ gap> tmpdir := Filename( DirectoryTemporary(), "packagemaker-git-retry-tst" );;
6868
gap> if IsDirectoryPath( tmpdir ) then RemoveDirectoryRecursively( tmpdir ); fi;
6969
gap> AUTODOC_CreateDirIfMissing( tmpdir );
7070
true
71-
gap> Assert( 0,
72-
> PKGMKR_CommandOutput( Directory( tmpdir ), "git", [ "init", "-b", "main" ] ) <> fail );;
73-
gap> Assert( 0,
74-
> PKGMKR_CommandOutput( Directory( tmpdir ), "git",
75-
> [ "config", "user.name", "PackageMaker Tests" ] ) <> fail );;
76-
gap> Assert( 0,
77-
> PKGMKR_CommandOutput( Directory( tmpdir ), "git",
78-
> [ "config", "user.email", "tests@example.invalid" ] ) <> fail );;
71+
gap> PKGMKR_CommandOutput( Directory( tmpdir ), "git", [ "init", "-b", "main" ] ) <> fail;
72+
true
73+
gap> PKGMKR_CommandOutput( Directory( tmpdir ), "git",
74+
> [ "config", "user.name", "PackageMaker Tests" ] ) <> fail;
75+
true
76+
gap> PKGMKR_CommandOutput( Directory( tmpdir ), "git",
77+
> [ "config", "user.email", "tests@example.invalid" ] ) <> fail;
78+
true
7979
gap> PrintTo( Filename( Directory( tmpdir ), "README.md" ), "probe\n" );;
8080
gap> attempt := 0;;
8181
gap> CreateGitRepository(

tst/template.tst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,29 +17,29 @@ gap> ChangeDirectoryCurrent( tmpdir );;
1717
gap> AUTODOC_CreateDirIfMissing( pkginfo.PackageName );
1818
true
1919
gap> TranslateTemplate( fail, "README.md", pkginfo );;
20-
gap> Assert( 0,
21-
> PositionSublist( StringFile( Filename( Directory( pkginfo.PackageName ), "README.md" ) ),
22-
> "# The GAP package DemoPackage" ) = 1 );;
20+
gap> PositionSublist( StringFile( Filename( Directory( pkginfo.PackageName ), "README.md" ) ),
21+
> "# The GAP package DemoPackage" ) = 1;
22+
true
2323
gap> AUTODOC_CreateDirIfMissing( Concatenation( pkginfo.PackageName, "/gap" ) );
2424
true
2525
gap> TranslateTemplate( "gap/PKG.gd",
2626
> Concatenation( "gap/", pkginfo.PackageName, ".gd" ),
2727
> pkginfo );;
28-
gap> Assert( 0,
29-
> PositionSublist(
28+
gap> PositionSublist(
3029
> StringFile( Filename( Directory( Concatenation( pkginfo.PackageName, "/gap" ) ),
3130
> Concatenation( pkginfo.PackageName, ".gd" ) ) ),
32-
> "DeclareGlobalFunction( \"DemoPackage_Example\" );" ) <> fail );;
31+
> "DeclareGlobalFunction( \"DemoPackage_Example\" );" ) <> fail;
32+
true
3333
gap> AUTODOC_CreateDirIfMissing( Concatenation( pkginfo.PackageName, "/.github" ) );
3434
true
3535
gap> AUTODOC_CreateDirIfMissing( Concatenation( pkginfo.PackageName, "/.github/workflows" ) );
3636
true
3737
gap> CopyTemplate( fail, ".github/workflows/CI.yml", pkginfo );;
38-
gap> Assert( 0,
39-
> StringFile( Filename( Directory( Concatenation( pkginfo.PackageName, "/.github/workflows" ) ),
38+
gap> StringFile( Filename( Directory( Concatenation( pkginfo.PackageName, "/.github/workflows" ) ),
4039
> "CI.yml" ) ) =
4140
> StringFile( Filename( DirectoriesPackageLibrary( "PackageMaker", "templates" )[1],
42-
> ".github/workflows/CI.yml" ) ) );;
41+
> ".github/workflows/CI.yml" ) );
42+
true
4343
gap> ChangeDirectoryCurrent( olddir );;
4444
gap> RemoveDirectoryRecursively( tmpdir );;
4545

0 commit comments

Comments
 (0)