| 
									
										
										
										
											2019-10-12 23:23:16 +08:00
										 |  |  | # frozen_string_literal: true | 
					
						
							| 
									
										
										
										
											2022-01-13 17:05:07 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-12-14 17:47:17 +08:00
										 |  |  | require "test_helper" | 
					
						
							| 
									
										
										
										
											2019-06-14 14:11:27 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-03 21:41:39 +08:00
										 |  |  | class HelperTest < Minitest::Test | 
					
						
							| 
									
										
										
										
											2023-12-14 17:47:17 +08:00
										 |  |  |   include CompileCacheISeqHelper | 
					
						
							|  |  |  |   include TmpdirHelper | 
					
						
							| 
									
										
										
										
											2019-06-14 14:11:27 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |   def test_validate_cache_path | 
					
						
							| 
									
										
										
										
											2022-01-13 17:05:07 +08:00
										 |  |  |     path = Help.set_file("a.rb", "a = a = 3", 100) | 
					
						
							| 
									
										
										
										
											2022-01-13 19:51:39 +08:00
										 |  |  |     cp = Help.cache_path("#{@tmp_dir}-iseq", path) | 
					
						
							| 
									
										
										
										
											2019-06-14 14:11:27 +08:00
										 |  |  |     load(path) | 
					
						
							|  |  |  |     assert_equal(true, File.file?(cp)) | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | end |