mirror of
https://github.com/go-admin-team/go-admin.git
synced 2026-09-22 18:37:43 +00:00
Two tests in this package each wrote out what an installed sys_app row looks like, field for field, and a third inlined the same Create with a different status. One appRow(t, db, code, status) now covers all three, so a new NOT NULL column on SysApp is one edit rather than three. One assertion counted with a bare db.Model(...).Count(&n) and dropped the error that call returns. A failing query leaves n at zero, which is exactly what that assertion wanted to see - so the test would have passed on a broken query. The package already had a count helper that fails on the error, and this now uses it. Also a cycle reached from outside itself. The existing case walks straight into its own cycle from the first code, so the path trimming had nothing to do and replacing it with the untrimmed path left the test green - the trimming was never covered. With a requiring b, b requiring c and c requiring b, the untrimmed report names a as part of a cycle it is not in, and the test goes red.