Skip to content

Record

sh
rails-anything record <repo> <unit-id>                         # generated edge cases
rails-anything record <repo> <unit-id> --inputs real.jsonl     # {"fn": name, "args": [...]} per line
rails-anything record <repo> <unit-id> --from-tests -- pytest  # or: npx jest, npx vitest run, node --test
rails-anything record <repo> <unit-id> --pin-clock             # time and dates read 2026-01-01T00:00:00Z

record original को generated और दिए गए inputs पर चलाता है और हर call जो return, raise और print करती है, उसे rails/port/cases/*.jsonl में सेव करता है। यही cases वह spec हैं जिससे port को मेल खाना है।

आपके tests cases बन जाते हैं

--from-tests -- <test command> original का अपना test suite चलाता है, function को instrument करके (Python, TypeScript, JavaScript), और उसकी हर अलग call generated cases के साथ एक case बन जाती है (सिर्फ़ इन्हीं के लिए --no-generate)। बाद में source file byte-for-byte restore हो जाती है, crash होने पर भी।

Clock

जब function clock पढ़ता है (datetime.now, Date.now, time.time, date.today), तो --pin-clock के साथ record करें। तब original को 2026-01-01T00:00:00Z दिखता है, और diff port को Time.now, Date.today और DateTime.now उसी पल पर freeze करके चलाता है।

Random numbers भाषाओं के बीच मेल नहीं खा सकते: इसके बजाय random value को एक argument बना दें (या कोई generator inject करें)।

इस page को GitHub पर edit करें →