diff --git a/test/functions/FileSeek.cfc b/test/functions/FileSeek.cfc new file mode 100644 index 0000000000..79a1b72ffe --- /dev/null +++ b/test/functions/FileSeek.cfc @@ -0,0 +1,23 @@ +component extends="org.lucee.cfml.test.LuceeTestCase" { + + function run( testResults , testBox ) { + describe( title = "Testcase for fileSeek() function", body = function() { + it( title = "checking fileSeek() function", body = function( currentSpec ) { + var file = getTempFile( getTempDirectory(), "fileSeek", "txt" ); + fileWrite( file, "123" ); + var file = fileOpen( file=file, mode="write", seekable=true ); + + fileSeek( file, 3 ); + fileWrite( file, 45 ); + expect( fileRead( file ) ).toBe( "12345" ); + + fileSeek( file, 2 ); + fileWrite( file, 45 ); + expect( fileRead( file ) ).toBe( "12455" ); + + fileclose( file ); + if( fileExists( file ) ) fileDelete( file ); + }); + }); + } +} \ No newline at end of file